SnakeBridge.Config.Library (SnakeBridge v0.14.0)

Copy Markdown View Source

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 when generate: :all:
    • :root / :light / :top - Only the root module
    • :public / :standard - Discover submodules and keep public API modules
    • :all / :nuclear - Discover all submodules (including private)
    • {:only, ["linalg", "fft"]} - Explicit submodule allowlist
  • :submodules - When true, introspect all submodules (can generate thousands of files)
  • :public_api - When true with submodules: 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

Summary

Types

generate_mode()

@type generate_mode() :: :all | :used

module_mode()

@type module_mode() :: :root | :public | :all | {:only, [String.t()]}

t()

@type t() :: %SnakeBridge.Config.Library{
  docs_url: String.t() | nil,
  exclude: [String.t()],
  extras: [String.t()],
  generate: generate_mode(),
  include: [String.t()],
  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(),
  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
}