STAC¶
STAC catalog management, item builders, validators, and backends.
Backend Protocol¶
fair.stac.backend
¶
StacBackend
¶
Bases: Protocol
Structural interface for STAC catalog operations.
StacCatalogManager (local JSON) and PgStacBackend (pgstac) both conform without explicit inheritance.
Catalog Manager¶
fair.stac.catalog_manager
¶
PgSTAC Backend¶
fair.stac.pgstac_backend
¶
PgStacBackend(dsn, stac_api_url)
¶
STAC backend using pypgstac Loader and pystac-client.
Writes use pypgstac's Loader (bulk upsert via COPY + pgstac SQL). Reads use pystac-client against the STAC API. Delete uses pgstac's delete_item() SQL function directly since Loader has no delete API.
Source code in fair/stac/pgstac_backend.py
Builders¶
fair.stac.builders
¶
Collections¶
fair.stac.collections
¶
create_base_models_collection()
¶
base-models: model blueprints contributed via PR.
Source code in fair/stac/collections.py
create_local_models_collection()
¶
local-models: finetuned models, only promoted versions.
Source code in fair/stac/collections.py
create_datasets_collection()
¶
datasets: training data registered via fAIr UI/backend.
Source code in fair/stac/collections.py
initialize_catalog(catalog_path)
¶
Create catalog.json + 3 empty collections. Saves to disk.
returns existing catalog if already present.