You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Pydantic](https://pydantic-docs.helpmanual.io/) models for [STAC](https://github.com/radiantearth/stac-spec) Catalogs, Collections, Items, and the [STAC API](https://github.com/radiantearth/stac-api-spec) spec. Initially developed by [arturo-ai](https://github.com/arturo-ai).
1
+
# stac-pydantic
2
+
3
+
[](https://github.com/stac-utils/stac-pydantic/actions/workflows/cicd.yml)
4
+
5
+
[Pydantic](https://pydantic-docs.helpmanual.io/) models for [STAC](https://github.com/radiantearth/stac-spec) Catalogs, Collections, Items, and the [STAC API](https://github.com/radiantearth/stac-api-spec) spec.
6
+
Initially developed by [arturo-ai](https://github.com/arturo-ai).
7
+
8
+
The main purpose of this library is to provide reusable request/response models for tools such as [fastapi](https://fastapi.tiangolo.com/).
9
+
For more comprehensive schema validation and robust extension support, use [pystac](https://github.com/stac-utils/pystac).
STAC defines many extensions which let the user customize the data in their catalog. `stac-pydantic.extensions.validate_extensions` will validate a `dict`, `Item`, `Collection` or `Catalog` against the schema urls provided in the `stac_extensions` property:
The complete list of current STAC Extensions can be found [here](https://stac-extensions.github.io/).
109
120
110
121
#### Vendor Extensions
122
+
111
123
The same procedure described above works for any STAC Extension schema as long as it can be loaded from a public url.
112
124
113
125
### STAC API
126
+
114
127
The [STAC API Specs](https://github.com/radiantearth/stac-api-spec) extent the core STAC specification for implementing dynamic catalogs. STAC Objects used in an API context should always import models from the `api` subpackage. This package extends
115
128
Catalog, Collection, and Item models with additional fields and validation rules and introduces Collections and ItemCollections models and Pagination/ Search Links.
116
129
It also implements models for defining ItemSeach queries.
Most STAC extensions are namespaced with a colon (ex `eo:gsd`) to keep them distinct from other extensions. Because
166
180
Python doesn't support the use of colons in variable names, we use [Pydantic aliasing](https://pydantic-docs.helpmanual.io/usage/model_config/#alias-generator)
167
181
to add the namespace upon model export. This requires [exporting](https://pydantic-docs.helpmanual.io/usage/exporting_models/)
0 commit comments