bridge.bootstrap.base module#
Core in-memory registries and helpers for registration and lookup of schemas, repo providers, and pipeline bindings. This is the dependency map the handlers and pipelines rely on.
- class bridge.bootstrap.base.BridgeRegistration(pipelines)[source]#
Bases:
objectHolds the mapping between PipelineGoals and their corresponding pipeline functions and argument models.
- Parameters:
pipelines (dict[PipelineGoal, tuple[callable, type[PipelineArgs]]]) – Each entry maps a PipelineGoal to (pipeline_function, args_model_class).
- class bridge.bootstrap.base.RepoRegistration(composer, provider_cls)[source]#
Bases:
objectHolds the composer function and type[RepoProvider] class for a given repo type.
- Parameters:
composer (callable) – Function that composes repo models.
provider_cls (type[RepoProvider]) – The type[RepoProvider] class for providing repository interactions.
- class bridge.bootstrap.base.SchemaRegistration(composer)[source]#
Bases:
objectHolds the composer function for a given schema.
- Parameters:
composer (callable) – Function that composes metadata models for the schema.
- bridge.bootstrap.base.get_handler(goal)[source]#
Retrieve the handler function for a specific pipeline goal.
- Parameters:
goal (PipelineGoal) – The pipeline goal.
- Returns:
The handler function for the specified goal.
- Return type:
callable
- bridge.bootstrap.base.get_pipeline(schema, repo_type, goal)[source]#
Retrieve the pipeline function and argument model for a given schema, repo_type, and goal.
- Parameters:
schema (str) – The name of the schema (e.g., “biotools”).
repo_type (str) – The type of the repository (e.g., “github”).
goal (PipelineGoal) – The pipeline goal.
- Returns:
The (pipeline_function, args_model_class) for the specified combination.
- Return type:
tuple[callable, type[PipelineArgs]]
- bridge.bootstrap.base.get_repo_components(repo_type)[source]#
Retrieve the (composer_function, RepoProviderClass) tuple for a given repo type.
- Parameters:
repo_type (str) – The type of the repository (e.g., “github”).
- Returns:
The (composer_function, RepoProviderClass) for the repo type.
- Return type:
tuple[callable, type[RepoProvider]]
- bridge.bootstrap.base.get_schema_composer(schema)[source]#
Retrieve the composer function for a given schema.
- Parameters:
schema (str) – The name of the schema (e.g., “biotools”).
- Returns:
The composer function for the schema.
- Return type:
callable
- bridge.bootstrap.base.register_bridge(schema, repo_type, *, pipelines)[source]#
Register the mapping between a schema and repo type to their pipelines.
- Parameters:
schema (str) – The name of the schema (e.g., “biotools”).
repo_type (str) – The type of the repository (e.g., “github”).
pipelines (dict[PipelineGoal, tuple[callable, type[PipelineArgs]]]) – Each entry maps a PipelineGoal to (pipeline_function, args_model_class).
- bridge.bootstrap.base.register_repo(repo_type, *, composer, provider_cls)[source]#
Register a repository type with its composer function and type[RepoProvider] class.
- Parameters:
repo_type (str) – The type of the repository to register (e.g., “github”).
composer (callable) – Function that composes repo models.
provider_cls (type[RepoProvider]) – The type[RepoProvider] class for providing repository interactions.