Skip to content

Commit ea8ef04

Browse files
committed
Merge branch 'main' of github.com:stac-utils/stac-fastapi into patch_endpoints
2 parents 7f9ff4b + 417ea2c commit ea8ef04

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+819
-267
lines changed

.github/workflows/cicd.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ jobs:
5555

5656
benchmark:
5757
needs: [test]
58-
runs-on: ubuntu-20.04
58+
runs-on: ubuntu-latest
5959
steps:
6060
- name: Check out repository code
6161
uses: actions/checkout@v4

.github/workflows/deploy_mkdocs.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,5 @@ jobs:
3333
stac_fastapi/api[docs] \
3434
stac_fastapi/extensions[docs] \
3535
36-
- name: update API docs
37-
run: |
38-
pdocs as_markdown \
39-
--output_dir docs/src/api/ \
40-
--exclude_source \
41-
--overwrite \
42-
stac_fastapi
43-
4436
- name: Deploy docs
4537
run: mkdocs gh-deploy --force -f docs/mkdocs.yml

CHANGES.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,18 @@
44

55
* Add Item and Collection `PATCH` endpoints with support for [RFC 6902](https://tools.ietf.org/html/rfc6902) and [RFC 7396](https://tools.ietf.org/html/rfc7386)
66

7+
## [5.2.0] - 2025-04-18
8+
9+
### Fixed
10+
11+
- Remove defaults in OpenAPI schemas
12+
- Type Hints for TypedDict
13+
14+
### Added
15+
16+
- add `enable_direct_response` settings to by-pass Pydantic validation and FastAPI serialization for responses
17+
- add `/_mgmt/health` endpoint (`readiness`) and `health_check: Callable[[], [Dict]` optional attribute in `StacApi` class
18+
719
## [5.1.1] - 2025-03-17
820

921
### Fixed
@@ -370,7 +382,7 @@ Full changelog: https://stac-utils.github.io/stac-fastapi/migrations/v3.0.0/#cha
370382
### Added
371383

372384
* Nginx service as second docker-compose stack to demonstrate proxy ([#503](https://github.com/stac-utils/stac-fastapi/pull/503))
373-
* Validation checks in CI using [stac-api-validator](github.com/stac-utils/stac-api-validator) ([#508](https://github.com/stac-utils/stac-fastapi/pull/508))
385+
* Validation checks in CI using [stac-api-validator](https://github.com/stac-utils/stac-api-validator) ([#508](https://github.com/stac-utils/stac-fastapi/pull/508))
374386
* Required links to the sqlalchemy ItemCollection endpoint ([#508](https://github.com/stac-utils/stac-fastapi/pull/508))
375387
* Publication of docker images to GHCR ([#525](https://github.com/stac-utils/stac-fastapi/pull/525))
376388

@@ -604,7 +616,8 @@ Full changelog: https://stac-utils.github.io/stac-fastapi/migrations/v3.0.0/#cha
604616

605617
* First PyPi release!
606618

607-
[Unreleased]: <https://github.com/stac-utils/stac-fastapi/compare/5.1.1..main>
619+
[Unreleased]: <https://github.com/stac-utils/stac-fastapi/compare/5.2.0..main>
620+
[5.2.0]: <https://github.com/stac-utils/stac-fastapi/compare/5.1.1..5.2.0>
608621
[5.1.1]: <https://github.com/stac-utils/stac-fastapi/compare/5.1.0..5.1.1>
609622
[5.1.0]: <https://github.com/stac-utils/stac-fastapi/compare/5.0.3..5.1.0>
610623
[5.0.3]: <https://github.com/stac-utils/stac-fastapi/compare/5.0.2..5.0.3>

CONTRIBUTING.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,6 @@ To manually deploy docs (note you should never need to do this because GitHub
3636
Actions deploys automatically for new commits.):
3737

3838
```bash
39-
Create API documentations
40-
$ pdocs as_markdown \
41-
--output_dir docs/src/api/ \
42-
--exclude_source \
43-
--overwrite \
44-
stac_fastapi
45-
4639
# deploy
4740
$ mkdocs gh-deploy -f docs/mkdocs.yml
4841
```

Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.11-slim as base
1+
FROM python:3.12-slim AS base
22

33
# Any python libraries that require system libraries to be installed will likely
44
# need the following packages in order to build
@@ -10,12 +10,13 @@ RUN apt-get update && \
1010

1111
ENV CURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
1212

13-
FROM base as builder
13+
FROM base AS builder
1414

1515
WORKDIR /app
1616

1717
COPY . /app
1818

19-
RUN python -m pip install -e ./stac_fastapi/types[dev] && \
20-
python -m pip install -e ./stac_fastapi/api[dev] && \
21-
python -m pip install -e ./stac_fastapi/extensions[dev]
19+
RUN python -m pip install \
20+
-e ./stac_fastapi/types[dev] \
21+
-e ./stac_fastapi/api[dev] \
22+
-e ./stac_fastapi/extensions[dev]

Dockerfile.docs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,19 @@
1-
FROM python:3.11-slim
1+
FROM python:3.12-slim
22

33
# build-essential is required to build a wheel for ciso8601
4-
RUN apt update && apt install -y build-essential
4+
RUN apt update && apt install -y build-essential && \
5+
apt-get clean && \
6+
rm -rf /var/lib/apt/lists/*
57

68
RUN python -m pip install --upgrade pip
7-
RUN python -m pip install mkdocs mkdocs-material pdocs
89

910
COPY . /opt/src
1011

1112
WORKDIR /opt/src
1213

1314
RUN python -m pip install \
14-
stac_fastapi/types \
15-
stac_fastapi/api \
16-
stac_fastapi/extensions
15+
"stac_fastapi/types[docs]" \
16+
"stac_fastapi/api[docs]" \
17+
"stac_fastapi/extensions[docs]"
1718

18-
CMD ["pdocs", \
19-
"as_markdown", \
20-
"--output_dir", \
21-
"docs/api/", \
22-
"--exclude_source", \
23-
"--overwrite", \
24-
"stac_fastapi"]
19+
CMD ["mkdocs", "build", "-f", "docs/mkdocs.yml"]

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ install:
1111

1212
.PHONY: docs-image
1313
docs-image:
14-
docker compose -f docker-compose.docs.yml \
14+
docker compose -f compose.docs.yml \
1515
build
1616

1717
.PHONY: docs
1818
docs: docs-image
19-
docker compose -f docker-compose.docs.yml \
19+
docker compose -f compose.docs.yml \
2020
run docs
2121

2222
.PHONY: test

README.md

Lines changed: 31 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<!-- markdownlint-disable MD033 MD041 -->
22

33
<p align="center">
4-
<img src="https://github.com/radiantearth/stac-site/raw/master/images/logo/stac-030-long.png" width=400>
4+
<img src="https://github.com/radiantearth/stac-site/raw/master/images/logo/stac-030-long.png" width=400 alt="SpatioTemporal Asset Catalog (STAC) logo">
55
<p align="center">FastAPI implemention of the STAC API spec.</p>
66
</p>
77
<p align="center">
@@ -21,25 +21,35 @@
2121

2222
---
2323

24-
Python library for building a STAC compliant FastAPI application. The project is split up into several namespace
25-
packages:
24+
Python library for building a STAC-compliant FastAPI application.
2625

27-
| Package | Description | Version
28-
| ------- |------------- | -------
29-
[**stac_fastapi.api**](https://github.com/stac-utils/stac-fastapi/tree/main/stac_fastapi/api) | An API layer which enforces the [stac-api-spec](https://github.com/radiantearth/stac-api-spec). | [![stac-fastapi.api](https://img.shields.io/pypi/v/stac-fastapi.api?color=%2334D058&label=pypi)](https://pypi.org/project/stac-fastapi.api)
30-
[**stac_fastapi.extensions**](https://github.com/stac-utils/stac-fastapi/tree/main/stac_fastapi/extensions) | Abstract base classes for [STAC API extensions](https://github.com/radiantearth/stac-api-spec/blob/master/extensions.md) and third-party extensions. | [![stac-fastapi.extensions](https://img.shields.io/pypi/v/stac-fastapi.extensions?color=%2334D058&label=pypi)](https://pypi.org/project/stac-fastapi.extensions)
31-
[**stac_fastapi.types**](https://github.com/stac-utils/stac-fastapi/tree/main/stac_fastapi/types) | Shared types and abstract base classes used by the library. | [![stac-fastapi.types](https://img.shields.io/pypi/v/stac-fastapi.types?color=%2334D058&label=pypi)](https://pypi.org/project/stac-fastapi.types)
26+
`stac-fastapi` was initially developed by [arturo-ai](https://github.com/arturo-ai).
27+
28+
The project contains several namespace packages:
29+
30+
| Package | Description | Version |
31+
| ------- |------------- | ------- |
32+
| [**stac_fastapi.api**](https://github.com/stac-utils/stac-fastapi/tree/main/stac_fastapi/api) | An API layer which enforces the [stac-api-spec](https://github.com/radiantearth/stac-api-spec). | [![stac-fastapi.api](https://img.shields.io/pypi/v/stac-fastapi.api?color=%2334D058&label=pypi)](https://pypi.org/project/stac-fastapi.api) |
33+
| [**stac_fastapi.extensions**](https://github.com/stac-utils/stac-fastapi/tree/main/stac_fastapi/extensions) | Abstract base classes for [STAC API extensions](https://github.com/radiantearth/stac-api-spec/blob/master/extensions.md) and third-party extensions. | [![stac-fastapi.extensions](https://img.shields.io/pypi/v/stac-fastapi.extensions?color=%2334D058&label=pypi)](https://pypi.org/project/stac-fastapi.extensions) |
34+
| [**stac_fastapi.types**](https://github.com/stac-utils/stac-fastapi/tree/main/stac_fastapi/types) | Shared types and abstract base classes used by the library. | [![stac-fastapi.types](https://img.shields.io/pypi/v/stac-fastapi.types?color=%2334D058&label=pypi)](https://pypi.org/project/stac-fastapi.types) |
3235

3336
#### Backends
3437

35-
Backends are hosted in their own repositories:
38+
In addition to the packages in this repository, a server implemention will also require the selection of a backend to
39+
connect with a database for STAC metadata storage. There are several different backend options, and each has their own
40+
repository.
3641

37-
- [stac-fastapi-pgstac](https://github.com/stac-utils/stac-fastapi-pgstac): Postgres backend implementation with [PgSTAC](https://github.com/stac-utils/pgstac).
38-
- [stac-fastapi-elasticsearch](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch): Backend implementation with [Elasticsearch](https://github.com/elastic/elasticsearch).
39-
- [stac-fastapi-sqlalchemy](https://github.com/stac-utils/stac-fastapi-sqlalchemy): Postgres backend implementation with [sqlalchemy](https://www.sqlalchemy.org/).
42+
The two most widely-used and supported backends are:
4043

41-
`stac-fastapi` was initially developed by [arturo-ai](https://github.com/arturo-ai).
44+
- [stac-fastapi-pgstac](https://github.com/stac-utils/stac-fastapi-pgstac): [PostgreSQL](https://github.com/postgres/postgres) + [PostGIS](https://github.com/postgis/postgis) via [PgSTAC](https://github.com/stac-utils/pgstac).
45+
- [stac-fastapi-elasticsearch-opensearch](https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch): [Elasticsearch](https://github.com/elastic/elasticsearch) or [OpenSearch](https://github.com/opensearch-project/OpenSearch)
4246

47+
Other implementations include:
48+
49+
- [stac-fastapi-mongo](https://github.com/Healy-Hyperspatial/stac-fastapi-mongo): [MongoDB](https://github.com/mongodb/mongo)
50+
- [stac-fastapi-geoparquet)](https://github.com/stac-utils/stac-fastapi-geoparquet): [GeoParquet](https://geoparquet.org) via [stacrs](https://github.com/stac-utils/stacrs) (experimental)
51+
- [stac-fastapi-duckdb](https://github.com/Healy-Hyperspatial/stac-fastapi-duckdb): [DuckDB](https://github.com/duckdb/duckdb) (experimental)
52+
- [stac-fastapi-sqlalchemy](https://github.com/stac-utils/stac-fastapi-sqlalchemy): [PostgreSQL](https://github.com/postgres/postgres) + [PostGIS](https://github.com/postgis/postgis) via [SQLAlchemy](https://www.sqlalchemy.org/) (abandoned in favor of stac-fastapi-pgstac)
4353

4454
## Response Model Validation
4555

@@ -51,16 +61,13 @@ To turn on response validation, set `ENABLE_RESPONSE_MODELS` to `True`. Either a
5161

5262
With the introduction of Pydantic 2, the extra [time it takes to validate models became negatable](https://github.com/stac-utils/stac-fastapi/pull/625#issuecomment-2045824578). While `ENABLE_RESPONSE_MODELS` still defaults to `False` there should be no penalty for users to turn on this feature but users discretion is advised.
5363

54-
5564
## Installation
5665

5766
```bash
5867
# Install from PyPI
5968
python -m pip install stac-fastapi.types stac-fastapi.api stac-fastapi.extensions
6069

6170
# Install a backend of your choice
62-
python -m pip install stac-fastapi.sqlalchemy
63-
# or
6471
python -m pip install stac-fastapi.pgstac
6572
```
6673

@@ -71,14 +78,18 @@ Other backends may be available from other sources, search [PyPI](https://pypi.o
7178
Install the packages in editable mode:
7279

7380
```shell
74-
python -m pip install -e \
75-
'stac_fastapi/types[dev]' \
76-
'stac_fastapi/api[dev]' \
77-
'stac_fastapi/extensions[dev]'
81+
python -m pip install \
82+
-e 'stac_fastapi/types[dev]' \
83+
-e 'stac_fastapi/api[dev]' \
84+
-e 'stac_fastapi/extensions[dev]'
7885
```
7986

8087
To run the tests:
8188

8289
```shell
8390
python -m pytest
8491
```
92+
93+
## Releasing
94+
95+
See [RELEASING.md](./RELEASING.md).

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.1.1
1+
5.2.0

compose.docs.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
services:
2+
docs:
3+
container_name: stac-fastapi-docs-dev
4+
build:
5+
context: .
6+
dockerfile: Dockerfile.docs
7+
platform: linux/amd64
8+
volumes:
9+
- .:/opt/src

docker-compose.docs.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

docs/mkdocs.yml

Lines changed: 49 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,39 @@ nav:
3030
- models: api/stac_fastapi/api/models.md
3131
- openapi: api/stac_fastapi/api/openapi.md
3232
- routes: api/stac_fastapi/api/routes.md
33-
- version: api/stac_fastapi/api/version.md
3433
- stac_fastapi.extensions:
3534
- module: api/stac_fastapi/extensions/index.md
3635
- core:
3736
- module: api/stac_fastapi/extensions/core/index.md
38-
- context: api/stac_fastapi/extensions/core/context.md
39-
- free_text:
40-
- module: api/stac_fastapi/extensions/core/free_text/index.md
41-
- free_text: api/stac_fastapi/extensions/core/free_text/free_text.md
42-
- request: api/stac_fastapi/extensions/core/free_text/request.md
43-
- filter:
44-
- module: api/stac_fastapi/extensions/core/filter/index.md
45-
- filter: api/stac_fastapi/extensions/core/filter/filter.md
46-
- request: api/stac_fastapi/extensions/core/filter/request.md
37+
- aggregation:
38+
- module: api/stac_fastapi/extensions/core/aggregation/index.md
39+
- aggregation: api/stac_fastapi/extensions/core/aggregation/aggregation.md
40+
- client: api/stac_fastapi/extensions/core/aggregation/client.md
41+
- request: api/stac_fastapi/extensions/core/aggregation/request.md
42+
- types: api/stac_fastapi/extensions/core/aggregation/types.md
43+
- collection_search:
44+
- module: api/stac_fastapi/extensions/core/collection_search/index.md
45+
- collection_search: api/stac_fastapi/extensions/core/collection_search/collection_search.md
46+
- client: api/stac_fastapi/extensions/core/collection_search/client.md
47+
- request: api/stac_fastapi/extensions/core/collection_search/request.md
4748
- fields:
4849
- module: api/stac_fastapi/extensions/core/fields/index.md
4950
- fields: api/stac_fastapi/extensions/core/fields/fields.md
5051
- request: api/stac_fastapi/extensions/core/fields/request.md
52+
- filter:
53+
- module: api/stac_fastapi/extensions/core/filter/index.md
54+
- filter: api/stac_fastapi/extensions/core/filter/filter.md
55+
- request: api/stac_fastapi/extensions/core/filter/request.md
56+
- free_text:
57+
- module: api/stac_fastapi/extensions/core/free_text/index.md
58+
- free_text: api/stac_fastapi/extensions/core/free_text/free_text.md
59+
- request: api/stac_fastapi/extensions/core/free_text/request.md
60+
- pagination:
61+
- module: api/stac_fastapi/extensions/core/pagination/index.md
62+
- pagination: api/stac_fastapi/extensions/core/pagination/pagination.md
63+
- offset_pagination: api/stac_fastapi/extensions/core/pagination/offset_pagination.md
64+
- token_pagination: api/stac_fastapi/extensions/core/pagination/token_pagination.md
65+
- request: api/stac_fastapi/extensions/core/pagination/request.md
5166
- query:
5267
- module: api/stac_fastapi/extensions/core/query/index.md
5368
- query: api/stac_fastapi/extensions/core/query/query.md
@@ -57,14 +72,9 @@ nav:
5772
- request: api/stac_fastapi/extensions/core/sort/request.md
5873
- sort: api/stac_fastapi/extensions/core/sort/sort.md
5974
- transaction: api/stac_fastapi/extensions/core/transaction.md
60-
- pagination:
61-
- module: api/stac_fastapi/extensions/core/pagination/index.md
62-
- pagination: api/stac_fastapi/extensions/core/pagination/pagination.md
63-
- token_pagination: api/stac_fastapi/extensions/core/pagination/token_pagination.md
64-
- version: api/stac_fastapi/extensions/version.md
6575
- third_party:
76+
- module: api/stac_fastapi/extensions/third_party/index.md
6677
- bulk_transactions: api/stac_fastapi/extensions/third_party/bulk_transactions.md
67-
- index: api/stac_fastapi/extensions/third_party/index.md
6878
- stac_fastapi.types:
6979
- module: api/stac_fastapi/types/index.md
7080
- config: api/stac_fastapi/types/config.md
@@ -77,7 +87,6 @@ nav:
7787
- rfc3339: api/stac_fastapi/types/rfc3339.md
7888
- search: api/stac_fastapi/types/search.md
7989
- stac: api/stac_fastapi/types/stac.md
80-
- version: api/stac_fastapi/types/version.md
8190
- Migration Guides:
8291
- v2.5 -> v3.0: migrations/v3.0.0.md
8392
- v3.0 -> v4.0: migrations/v4.0.0.md
@@ -87,6 +96,29 @@ nav:
8796

8897
plugins:
8998
- search
99+
- mkdocstrings:
100+
enable_inventory: true
101+
handlers:
102+
python:
103+
paths: [src]
104+
options:
105+
docstring_section_style: list
106+
docstring_style: google
107+
line_length: 100
108+
separate_signature: true
109+
show_root_heading: true
110+
show_signature_annotations: true
111+
show_source: false
112+
show_symbol_type_toc: true
113+
signature_crossrefs: true
114+
extensions:
115+
- griffe_inherited_docstrings
116+
inventories:
117+
- https://docs.python.org/3/objects.inv
118+
- https://docs.pydantic.dev/latest/objects.inv
119+
- https://fastapi.tiangolo.com/objects.inv
120+
- https://www.starlette.io/objects.inv
121+
- https://www.attrs.org/en/stable/objects.inv
90122

91123
# Theme
92124
theme:

docs/src/api/stac_fastapi/api/app.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
::: stac_fastapi.api.app
2+
options:
3+
show_source: true
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
::: stac_fastapi.api.config
2+
options:
3+
show_source: true
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
::: stac_fastapi.api.errors
2+
options:
3+
show_source: true

0 commit comments

Comments
 (0)