{"id":28302,"library":"stac-pydantic","title":"stac-pydantic","description":"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.","status":"active","version":"3.5.1","language":"python","source_language":"en","source_url":"https://github.com/stac-utils/stac-pydantic","tags":["stac","pydantic","geospatial","validation","catalog"],"install":[{"cmd":"pip install stac-pydantic","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core validation framework; requires v2 for stac-pydantic >=3.0.0","package":"pydantic","optional":false}],"imports":[{"note":"The top-level import is preferred and equivalent.","wrong":"from stac_pydantic.catalog import Catalog","symbol":"Catalog","correct":"from stac_pydantic import Catalog"}],"quickstart":{"code":"from stac_pydantic import Catalog, Collection, Item\n\ncatalog = Catalog(\n    id='my-catalog',\n    description='An example catalog',\n    stac_version='1.0.0',\n    stac_extensions=[],\n    links=[]\n)\nprint(catalog.model_dump())","lang":"python","description":"Create a basic STAC Catalog and dump to dict."},"warnings":[{"fix":"Migrate to Pydantic v2 API: replace `.dict()` with `.model_dump()` and `parse_obj()` with `model_validate()`.","message":"Version 3.0.0 dropped Pydantic v1 support. Use `model_dump()` instead of `dict()`, `model_validate()` instead of `parse_obj()`.","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Always pass extension URIs as strings, e.g., `['https://stac-extensions.github.io/eo/v1.0.0/schema.json']`.","message":"The `stac_extensions` field expects a list of URIs (strings), not objects. Passing extension objects will raise a validation error.","severity":"gotcha","affected_versions":"all"},{"fix":"Import from `stac_pydantic.collections` and `stac_pydantic.links` as appropriate.","message":"The `from stac_pydantic.api import ItemCollection` and related API endpoints are deprecated and will be removed in 4.0. Use `stac_pydantic.collections.Collection` and `ItemCollection` from `stac_pydantic.links` instead.","severity":"deprecated","affected_versions":"<4.0"}],"env_vars":null,"last_verified":"2026-05-09T00:00:00.000Z","next_check":"2026-08-07T00:00:00.000Z","problems":[{"fix":"Set `model_config = {'extra': 'allow'}` on a subclass or use `strict=False` when creating the model (if supported).","cause":"STAC Item contains fields not defined in the spec or extensions. The model is strict by default.","error":"ValidationError: 1 validation error for Item\n...\n  Extra inputs are not permitted"},{"fix":"Upgrade to Pydantic v2 syntax: use `str | None` instead of `Optional[str]`.","cause":"Using Pydantic v1 syntax like `Optional[str]` inside a `Field` with v2. stac-pydantic uses Pydantic v2.","error":"TypeError: 'type' object is not subscriptable"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}