module documentation

Undocumented

Function add_infer_route Undocumented
Function add_read_data_route Undocumented
Function router_for_store Creates a FastAPI router that exposes all contracts for a given tag.
Function schema_for_dtype Undocumented
Variable logger Undocumented
def add_infer_route(route: fastapi.APIRouter | fastapi.FastAPI, location: FeatureLocation, store: ContractStore): (source)

Undocumented

def add_read_data_route(app: fastapi.APIRouter | fastapi.FastAPI, location: FeatureLocation, store: ContractStore): (source)

Undocumented

def router_for_store(store: ContractStore) -> fastapi.APIRouter:
def router_for_store(store: ContractStore, expose_tag: str | None) -> fastapi.APIRouter:
def router_for_store(store: ContractStore, expose_tag: str | None, app: fastapi.FastAPI | None):
(source)

Creates a FastAPI router that exposes all contracts for a given tag.

If a contract have a source will it setup.

/contracts/{contract-name}/read/entity /contracts/{contract-name}/read/entities

and if a model contract have an exposed model will it also setup

/contracts/{contract-name}/infer/entities

Args:
store (ContractStore): The contract store to expose. expose_tag (str | None): the tag to expose. Will default to is_exposed_through_api.
Returns:
APIRouter: A fastapi router
def schema_for_dtype(dtype: FeatureType, description: str | None = None, constraints: Iterable[Constraint] | None = None) -> dict: (source)

Undocumented

Undocumented