Skip to content

Commit ba4dba2

Browse files
committed
release: v3.0.0
1 parent f28081a commit ba4dba2

File tree

3 files changed

+23
-8
lines changed

3 files changed

+23
-8
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# See https://pre-commit.com/hooks.html for more hooks
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
5-
rev: v4.0.1
5+
rev: v4.5.0
66
hooks:
77
- id: end-of-file-fixer
88
- id: trailing-whitespace

README.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
1-
# stac-pydantic ![tests](https://github.com/arturo-ai/stac-pydantic/workflows/cicd/badge.svg)
2-
[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+
[![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/stac-utils/stac-pydantic/cicd.yml?style=for-the-badge)](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).
310

411
## Installation
5-
```
12+
13+
```shell
614
pip install stac-pydantic
715
```
816

917
For local development:
10-
```
11-
pip install -e ".[all]"
18+
19+
```shell
20+
pip install -e '.[dev,lint]'
1221
```
1322

1423
| stac-pydantic | STAC Version |
@@ -17,6 +26,7 @@ pip install -e ".[all]"
1726
| 1.2.x | 1.0.0-beta.1 |
1827
| 1.3.x | 1.0.0-beta.2 |
1928
| 2.0.x | 1.0.0 |
29+
| 3.0.x | 1.0.0 |
2030

2131
## Development
2232

@@ -78,6 +88,7 @@ assert catalog.links[0].href == "item.json"
7888
```
7989

8090
### Extensions
91+
8192
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:
8293

8394
```python
@@ -108,9 +119,11 @@ assert getattr(model.properties, "eo:cloud_cover") == 25
108119
The complete list of current STAC Extensions can be found [here](https://stac-extensions.github.io/).
109120

110121
#### Vendor Extensions
122+
111123
The same procedure described above works for any STAC Extension schema as long as it can be loaded from a public url.
112124

113125
### STAC API
126+
114127
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
115128
Catalog, Collection, and Item models with additional fields and validation rules and introduces Collections and ItemCollections models and Pagination/ Search Links.
116129
It also implements models for defining ItemSeach queries.
@@ -162,6 +175,7 @@ stac_item_collection = ItemCollection(**{
162175
```
163176

164177
### Exporting Models
178+
165179
Most STAC extensions are namespaced with a colon (ex `eo:gsd`) to keep them distinct from other extensions. Because
166180
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)
167181
to add the namespace upon model export. This requires [exporting](https://pydantic-docs.helpmanual.io/usage/exporting_models/)
@@ -173,7 +187,8 @@ assert item_dict['properties']['landsat:row'] == item.properties.row == 250
173187
```
174188

175189
### CLI
176-
```
190+
191+
```text
177192
Usage: stac-pydantic [OPTIONS] COMMAND [ARGS]...
178193
179194
stac-pydantic cli group

stac_pydantic/version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
__version__ = "2.0.3"
1+
__version__ = "3.0.0"
22
STAC_VERSION = "1.0.0"

0 commit comments

Comments
 (0)