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).
3
10
4
11
## Installation
5
-
```
12
+
13
+
```shell
6
14
pip install stac-pydantic
7
15
```
8
16
9
17
For local development:
18
+
19
+
```shell
20
+
pip install -e '.[dev,lint]'
10
21
```
11
-
pip install -e ".[all]"
12
-
```
13
22
14
-
| stac-pydantic | STAC Version |
15
-
|---------------|--------------|
16
-
| 1.1.x | 0.9.0 |
17
-
| 1.2.x | 1.0.0-beta.1 |
18
-
| 1.3.x | 1.0.0-beta.2 |
19
-
| 2.0.x | 1.0.0 |
23
+
| stac-pydantic | STAC Version | STAC API Version | Pydantic Version |
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
121
110
122
#### Vendor Extensions
123
+
111
124
The same procedure described above works for any STAC Extension schema as long as it can be loaded from a public url.
112
125
113
126
### STAC API
127
+
114
128
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
129
Catalog, Collection, and Item models with additional fields and validation rules and introduces Collections and ItemCollections models and Pagination/ Search Links.
116
130
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
181
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
182
to add the namespace upon model export. This requires [exporting](https://pydantic-docs.helpmanual.io/usage/exporting_models/)
0 commit comments