Pydantic data models for the SpatioTemporal Asset Catalog (STAC) specification. Provides Python classes for validating and serializing STAC objects (Catalogs, Collections, Items, associated extensions) with strict conformance to the STAC spec. Version 3.5.1 supports Pydantic v2 and Python >=3.8.
pip install stac-pydanticNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Create a basic STAC Catalog and dump to dict.
Migrate to Pydantic v2 API: replace `.dict()` with `.model_dump()` and `parse_obj()` with `model_validate()`.
Always pass extension URIs as strings, e.g., `['https://stac-extensions.github.io/eo/v1.0.0/schema.json']`.
Import from `stac_pydantic.collections` and `stac_pydantic.links` as appropriate.
Set `model_config = {'extra': 'allow'}` on a subclass or use `strict=False` when creating the model (if supported).Upgrade to Pydantic v2 syntax: use `str | None` instead of `Optional[str]`.