Configuration struct for a single Python library binding.
Options
:generate- Controls which symbols are generated::used(default) - Only generate wrappers for symbols detected in your code:all- Generate wrappers for ALL public symbols in the Python module
:module_mode- Controls which Python submodules are generated whengenerate: :all::root/:light/:top- Only the root module:exports/:api- Only the root module, plus submodules explicitly exported by the root module via__all__(avoids walking large internal trees):public/:standard- Discover submodules and keep public API modules:explicit- Discover submodules and keep only modules/packages that explicitly define__all__(smallest “discover” mode; usemodule_includefor overrides):docs/:manifest- Generate a docs-defined public surface from a manifest file:all/:nuclear- Discover all submodules (including private){:only, ["linalg", "fft"]}- Explicit submodule allowlist
:submodules- Whentrue, introspect all submodules (can generate thousands of files):public_api- Whentruewithsubmodules: true, only include modules with explicit public API (__all__defined or classes defined in the module). This filters out internal implementation modules, typically reducing generated files by 90%+.:module_include- Extra submodules to include (relative to the library root):module_exclude- Submodules to exclude (relative to the library root):module_depth- Limit discovery depth (e.g. 1 = only direct children):docs_url- Explicit documentation URL for third-party libraries:docs_manifest- Path to a SnakeBridge docs manifest JSON file (used withmodule_mode: :docs):docs_profile- Profile key insidedocs_manifest(:summary,:full, or custom string):class_method_scope- Controls how class methods are discovered during introspection::all(default) - include inherited methods (can be huge for tensor-like bases):defined- only methods defined on the class itself (plus__init__)
:max_class_methods- Guardrail for class method enumeration. Whenclass_method_scope: :allwould exceed this limit, SnakeBridge falls back to:definedfor that class.:on_not_found- Behavior when a requested symbol is not present in the current Python env::error- fail compilation (recommended forgenerate: :used):stub- generate deterministic stubs and continue (recommended for docs-derived surfaces)
Summary
Types
@type class_method_scope() :: :all | :defined
@type generate_mode() :: :all | :used
@type module_mode() :: :root | :exports | :public | :explicit | :docs | :all | {:only, [String.t()]}
@type on_not_found() :: :error | :stub
@type t() :: %SnakeBridge.Config.Library{ class_method_scope: class_method_scope() | nil, docs_manifest: String.t() | nil, docs_profile: String.t() | nil, docs_url: String.t() | nil, exclude: [String.t()], extras: [String.t()], generate: generate_mode(), include: [String.t()], max_class_methods: non_neg_integer() | nil, min_signature_tier: atom() | String.t() | nil, module_depth: pos_integer() | nil, module_exclude: [String.t()], module_include: [String.t()], module_mode: module_mode() | nil, module_name: module(), name: atom(), on_not_found: on_not_found() | nil, public_api: boolean(), pypi_package: String.t() | nil, python_name: String.t(), signature_sources: [atom() | String.t()] | nil, streaming: [String.t()], strict_signatures: boolean() | nil, stub_search_paths: [String.t()] | nil, stubgen: keyword() | nil, submodules: boolean(), typeshed_path: String.t() | nil, use_typeshed: boolean() | nil, version: String.t() | :stdlib | nil }