Skip to content

Commit c9fede6

Browse files
authored
release: v3.0.0 (#129)
1 parent f28081a commit c9fede6

File tree

3 files changed

+30
-14
lines changed

3 files changed

+30
-14
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: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,33 @@
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:
18+
19+
```shell
20+
pip install -e '.[dev,lint]'
1021
```
11-
pip install -e ".[all]"
12-
```
1322

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 |
24+
|--------------|---------------|------------------|-----------------|
25+
| 1.2.x | 1.0.0-beta.1 | <1* | ^1.6 |
26+
| 1.3.x | 1.0.0-beta.2 | <1* | ^1.6 |
27+
| 2.0.x | 1.0.0 | <1* | ^1.6 |
28+
| 3.0.x | 1.0.0 | 1.0.0 | ^2.4 |
29+
30+
\* various beta releases, specs not fully implemented
2031

2132
## Development
2233

@@ -78,6 +89,7 @@ assert catalog.links[0].href == "item.json"
7889
```
7990

8091
### Extensions
92+
8193
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:
8294

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

110122
#### Vendor Extensions
123+
111124
The same procedure described above works for any STAC Extension schema as long as it can be loaded from a public url.
112125

113126
### STAC API
127+
114128
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
115129
Catalog, Collection, and Item models with additional fields and validation rules and introduces Collections and ItemCollections models and Pagination/ Search Links.
116130
It also implements models for defining ItemSeach queries.
@@ -162,6 +176,7 @@ stac_item_collection = ItemCollection(**{
162176
```
163177

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

175190
### CLI
176-
```
191+
192+
```text
177193
Usage: stac-pydantic [OPTIONS] COMMAND [ARGS]...
178194
179195
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)