stac-fastapi-pgstac 6.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- stac_fastapi_pgstac-6.1.0/.gitignore +131 -0
- stac_fastapi_pgstac-6.1.0/LICENSE +21 -0
- stac_fastapi_pgstac-6.1.0/PKG-INFO +140 -0
- stac_fastapi_pgstac-6.1.0/README.md +97 -0
- stac_fastapi_pgstac-6.1.0/pyproject.toml +181 -0
- stac_fastapi_pgstac-6.1.0/stac_fastapi/pgstac/__init__.py +1 -0
- stac_fastapi_pgstac-6.1.0/stac_fastapi/pgstac/app.py +217 -0
- stac_fastapi_pgstac-6.1.0/stac_fastapi/pgstac/config.py +225 -0
- stac_fastapi_pgstac-6.1.0/stac_fastapi/pgstac/core.py +677 -0
- stac_fastapi_pgstac-6.1.0/stac_fastapi/pgstac/db.py +153 -0
- stac_fastapi_pgstac-6.1.0/stac_fastapi/pgstac/extensions/__init__.py +7 -0
- stac_fastapi_pgstac-6.1.0/stac_fastapi/pgstac/extensions/filter.py +40 -0
- stac_fastapi_pgstac-6.1.0/stac_fastapi/pgstac/extensions/free_text.py +31 -0
- stac_fastapi_pgstac-6.1.0/stac_fastapi/pgstac/extensions/query.py +47 -0
- stac_fastapi_pgstac-6.1.0/stac_fastapi/pgstac/models/__init__.py +1 -0
- stac_fastapi_pgstac-6.1.0/stac_fastapi/pgstac/models/links.py +339 -0
- stac_fastapi_pgstac-6.1.0/stac_fastapi/pgstac/transactions.py +370 -0
- stac_fastapi_pgstac-6.1.0/stac_fastapi/pgstac/types/base_item_cache.py +56 -0
- stac_fastapi_pgstac-6.1.0/stac_fastapi/pgstac/types/search.py +26 -0
- stac_fastapi_pgstac-6.1.0/stac_fastapi/pgstac/utils.py +114 -0
- stac_fastapi_pgstac-6.1.0/stac_fastapi/pgstac/version.py +3 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
.mypy_cache
|
|
2
|
+
|
|
3
|
+
PIP_EXTRA_INDEX_URL
|
|
4
|
+
!tests/resources/*.jpg
|
|
5
|
+
**.pyc
|
|
6
|
+
**.log
|
|
7
|
+
*.mat
|
|
8
|
+
target/*
|
|
9
|
+
src/local/*
|
|
10
|
+
src/local-test/*
|
|
11
|
+
*.iml
|
|
12
|
+
.idea/
|
|
13
|
+
model/
|
|
14
|
+
.DS_Store
|
|
15
|
+
#config.yaml
|
|
16
|
+
**.save
|
|
17
|
+
*.jpg
|
|
18
|
+
**.save.*
|
|
19
|
+
**.bak
|
|
20
|
+
.DS_Store
|
|
21
|
+
.mvn/
|
|
22
|
+
|
|
23
|
+
# Byte-compiled / optimized / DLL files
|
|
24
|
+
__pycache__/
|
|
25
|
+
*.py[cod]
|
|
26
|
+
*$py.class
|
|
27
|
+
|
|
28
|
+
# C extensions
|
|
29
|
+
*.so
|
|
30
|
+
|
|
31
|
+
# user specific overrides
|
|
32
|
+
tests/tests.ini
|
|
33
|
+
tests/logging.ini
|
|
34
|
+
|
|
35
|
+
# Distribution / packaging
|
|
36
|
+
.Python
|
|
37
|
+
env/
|
|
38
|
+
venv/
|
|
39
|
+
build/
|
|
40
|
+
develop-eggs/
|
|
41
|
+
dist/
|
|
42
|
+
downloads/
|
|
43
|
+
eggs/
|
|
44
|
+
.eggs/
|
|
45
|
+
lib/
|
|
46
|
+
lib64/
|
|
47
|
+
parts/
|
|
48
|
+
sdist/
|
|
49
|
+
var/
|
|
50
|
+
wheels/
|
|
51
|
+
*.egg-info/
|
|
52
|
+
.installed.cfg
|
|
53
|
+
*.egg
|
|
54
|
+
|
|
55
|
+
# PyInstaller
|
|
56
|
+
# Usually these files are written by a python script from a template
|
|
57
|
+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
|
|
58
|
+
*.manifest
|
|
59
|
+
*.spec
|
|
60
|
+
|
|
61
|
+
# Installer logs
|
|
62
|
+
pip-log.txt
|
|
63
|
+
pip-delete-this-directory.txt
|
|
64
|
+
|
|
65
|
+
# Unit test / coverage reports
|
|
66
|
+
htmlcov/
|
|
67
|
+
.coverage
|
|
68
|
+
.coverage.*
|
|
69
|
+
.cache
|
|
70
|
+
nosetests.xml
|
|
71
|
+
coverage.xml
|
|
72
|
+
*,cover
|
|
73
|
+
.hypothesis/
|
|
74
|
+
|
|
75
|
+
# Translations
|
|
76
|
+
*.mo
|
|
77
|
+
*.pot
|
|
78
|
+
|
|
79
|
+
# Django stuff:
|
|
80
|
+
*.log
|
|
81
|
+
local_settings.py
|
|
82
|
+
|
|
83
|
+
# Flask stuff:
|
|
84
|
+
instance/
|
|
85
|
+
.webassets-cache
|
|
86
|
+
|
|
87
|
+
# Scrapy stuff:
|
|
88
|
+
.scrapy
|
|
89
|
+
|
|
90
|
+
# Sphinx documentation
|
|
91
|
+
docs/_build/
|
|
92
|
+
|
|
93
|
+
# PyBuilder
|
|
94
|
+
target/
|
|
95
|
+
|
|
96
|
+
# Jupyter Notebook
|
|
97
|
+
.ipynb_checkpoints
|
|
98
|
+
|
|
99
|
+
# pyenv
|
|
100
|
+
.python-version
|
|
101
|
+
|
|
102
|
+
# celery beat schedule file
|
|
103
|
+
celerybeat-schedule
|
|
104
|
+
|
|
105
|
+
# SageMath parsed files
|
|
106
|
+
*.sage.py
|
|
107
|
+
|
|
108
|
+
# dotenv
|
|
109
|
+
**/.env
|
|
110
|
+
|
|
111
|
+
# Spyder project settings
|
|
112
|
+
.spyderproject
|
|
113
|
+
.spyproject
|
|
114
|
+
|
|
115
|
+
# Rope project settings
|
|
116
|
+
.ropeproject
|
|
117
|
+
|
|
118
|
+
# mkdocs documentation
|
|
119
|
+
/site
|
|
120
|
+
|
|
121
|
+
# skaffold temporary build/deploy files
|
|
122
|
+
build.out
|
|
123
|
+
|
|
124
|
+
# Direnv
|
|
125
|
+
.envrc
|
|
126
|
+
|
|
127
|
+
# Virtualenv
|
|
128
|
+
venv
|
|
129
|
+
|
|
130
|
+
# IDE
|
|
131
|
+
.vscode
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020 Arturo AI
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: stac-fastapi-pgstac
|
|
3
|
+
Version: 6.1.0
|
|
4
|
+
Summary: An implementation of STAC API based on the FastAPI framework and using the pgstac backend.
|
|
5
|
+
Project-URL: Homepage, https://github.com/stac-utils/stac-fastapi-pgstac
|
|
6
|
+
Author-email: David Bitner <david@developmentseed.org>
|
|
7
|
+
Maintainer-email: David Bitner <david@developmentseed.org>, Vincent Sarago <vincent@developmentseed.org>, Pete Gadomski <pete.gadomski@gmail.com>, Henry Rodman <henry@developmentseed.org>, Jeff Albrecht <geospatialjeff@gmail.com>
|
|
8
|
+
License-Expression: MIT
|
|
9
|
+
License-File: LICENSE
|
|
10
|
+
Keywords: FastAPI,PgSTAC,STAC,STAC-API
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Intended Audience :: Information Technology
|
|
13
|
+
Classifier: Intended Audience :: Science/Research
|
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
21
|
+
Requires-Python: >=3.9
|
|
22
|
+
Requires-Dist: asyncpg
|
|
23
|
+
Requires-Dist: attrs
|
|
24
|
+
Requires-Dist: brotli-asgi
|
|
25
|
+
Requires-Dist: buildpg
|
|
26
|
+
Requires-Dist: cql2>=0.3.6
|
|
27
|
+
Requires-Dist: hydraters>=0.1.3
|
|
28
|
+
Requires-Dist: json-merge-patch>=0.3.0
|
|
29
|
+
Requires-Dist: jsonpatch>=1.33.0
|
|
30
|
+
Requires-Dist: orjson
|
|
31
|
+
Requires-Dist: pydantic
|
|
32
|
+
Requires-Dist: pypgstac<0.10,>=0.9
|
|
33
|
+
Requires-Dist: stac-fastapi-api<7.0,>=6.1
|
|
34
|
+
Requires-Dist: stac-fastapi-extensions<7.0,>=6.1
|
|
35
|
+
Requires-Dist: stac-fastapi-types<7.0,>=6.1
|
|
36
|
+
Requires-Dist: typing-extensions>=4.9.0
|
|
37
|
+
Requires-Dist: uvicorn[standard]==0.38.0
|
|
38
|
+
Provides-Extra: server
|
|
39
|
+
Requires-Dist: uvicorn[standard]==0.38.0; extra == 'server'
|
|
40
|
+
Provides-Extra: validation
|
|
41
|
+
Requires-Dist: stac-pydantic[validation]; extra == 'validation'
|
|
42
|
+
Description-Content-Type: text/markdown
|
|
43
|
+
|
|
44
|
+
# stac-fastapi-pgstac
|
|
45
|
+
|
|
46
|
+
[](https://github.com/stac-utils/stac-fastapi-pgstac/actions/workflows/cicd.yaml)
|
|
47
|
+
[](https://pypi.org/project/stac-fastapi.pgstac)
|
|
48
|
+
[](https://stac-utils.github.io/stac-fastapi-pgstac/)
|
|
49
|
+
[](https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/LICENSE)
|
|
50
|
+
|
|
51
|
+
<p align="center">
|
|
52
|
+
<img src="https://user-images.githubusercontent.com/10407788/174893876-7a3b5b7a-95a5-48c4-9ff2-cc408f1b6af9.png" style="vertical-align: middle; max-width: 400px; max-height: 100px;" height=100 />
|
|
53
|
+
<img src="https://fastapi.tiangolo.com/img/logo-margin/logo-teal.png" alt="FastAPI" style="vertical-align: middle; max-width: 400px; max-height: 100px;" width=200 />
|
|
54
|
+
</p>
|
|
55
|
+
|
|
56
|
+
[PgSTAC](https://github.com/stac-utils/pgstac) backend for [stac-fastapi](https://github.com/stac-utils/stac-fastapi), the [FastAPI](https://fastapi.tiangolo.com/) implementation of the [STAC API spec](https://github.com/radiantearth/stac-api-spec)
|
|
57
|
+
|
|
58
|
+
## Overview
|
|
59
|
+
|
|
60
|
+
**stac-fastapi-pgstac** is an HTTP interface built in FastAPI.
|
|
61
|
+
It validates requests and data sent to a [PgSTAC](https://github.com/stac-utils/pgstac) backend, and adds [links](https://github.com/radiantearth/stac-spec/blob/master/item-spec/item-spec.md#link-object) to the returned data.
|
|
62
|
+
All other processing and search is provided directly using PgSTAC procedural sql / plpgsql functions on the database.
|
|
63
|
+
PgSTAC stores all collection and item records as jsonb fields exactly as they come in allowing for any custom fields to be stored and retrieved transparently.
|
|
64
|
+
|
|
65
|
+
## `PgSTAC` version
|
|
66
|
+
|
|
67
|
+
`stac-fastapi-pgstac` depends on [`pgstac`](https://stac-utils.github.io/pgstac/pgstac/) database schema and [`pypgstac`](https://stac-utils.github.io/pgstac/pypgstac/) python package.
|
|
68
|
+
|
|
69
|
+
| stac-fastapi-pgstac Version | pgstac |
|
|
70
|
+
| --| --|
|
|
71
|
+
| 2.5 | >=0.7,<0.8 |
|
|
72
|
+
| 3.0 | >=0.8,<0.9 |
|
|
73
|
+
| >=4.0 | >=0.8,<0.10|
|
|
74
|
+
|
|
75
|
+
## Usage
|
|
76
|
+
|
|
77
|
+
PgSTAC is an external project and may be used by multiple front ends.
|
|
78
|
+
For Stac FastAPI development, a Docker image (which is pulled as part of the docker-compose) is available via the [Github container registry](https://github.com/stac-utils/pgstac/pkgs/container/pgstac/81689794?tag=latest).
|
|
79
|
+
The PgSTAC version required by **stac-fastapi-pgstac** is found in the [setup](http://github.com/stac-utils/stac-fastapi-pgstac/blob/main/setup.py) file.
|
|
80
|
+
|
|
81
|
+
### Sorting
|
|
82
|
+
|
|
83
|
+
While the STAC [Sort Extension](https://github.com/stac-api-extensions/sort) is fully supported, [PgSTAC](https://github.com/stac-utils/pgstac) is particularly enhanced to be able to sort by datetime (either ascending or descending).
|
|
84
|
+
Sorting by anything other than datetime (the default if no sort is specified) on very large STAC repositories without very specific query limits (ie selecting a single day date range) will not have the same performance.
|
|
85
|
+
For more than millions of records it is recommended to either set a low connection timeout on PostgreSQL or to disable use of the Sort Extension.
|
|
86
|
+
|
|
87
|
+
### Hydration
|
|
88
|
+
|
|
89
|
+
To configure **stac-fastapi-pgstac** to [hydrate search result items at the API level](https://stac-utils.github.io/pgstac/pgstac/#runtime-configurations), set the `USE_API_HYDRATE` environment variable to `true`. If `false` (default) the hydration will be done in the database.
|
|
90
|
+
|
|
91
|
+
| use_api_hydrate (API) | nohydrate (PgSTAC) | Hydration |
|
|
92
|
+
| --- | --- | --- |
|
|
93
|
+
| False | False | PgSTAC |
|
|
94
|
+
| True | True | API |
|
|
95
|
+
|
|
96
|
+
### Migrations
|
|
97
|
+
|
|
98
|
+
There is a Python utility as part of PgSTAC ([pypgstac](https://stac-utils.github.io/pgstac/pypgstac/)) that includes a migration utility.
|
|
99
|
+
To use:
|
|
100
|
+
|
|
101
|
+
```shell
|
|
102
|
+
pypgstac migrate
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
## Development
|
|
106
|
+
|
|
107
|
+
Install the packages in editable mode:
|
|
108
|
+
|
|
109
|
+
We recommand using [`uv`](https://docs.astral.sh/uv) as project manager for development.
|
|
110
|
+
|
|
111
|
+
See https://docs.astral.sh/uv/getting-started/installation/ for installation
|
|
112
|
+
|
|
113
|
+
```shell
|
|
114
|
+
uv sync --dev
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
To run the tests:
|
|
118
|
+
|
|
119
|
+
```shell
|
|
120
|
+
uv run pytest
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Contributing
|
|
124
|
+
|
|
125
|
+
See [CONTRIBUTING](./contributing.md) for detailed contribution instructions.
|
|
126
|
+
|
|
127
|
+
## Releasing
|
|
128
|
+
|
|
129
|
+
See [RELEASING.md](./releasing.md).
|
|
130
|
+
|
|
131
|
+
## History
|
|
132
|
+
|
|
133
|
+
**stac-fastapi-pgstac** was initially added to **stac-fastapi** by [developmentseed](https://github.com/developmentseed).
|
|
134
|
+
In April of 2023, it was removed from the core **stac-fastapi** repository and moved to its current location (<http://github.com/stac-utils/stac-fastapi-pgstac>).
|
|
135
|
+
|
|
136
|
+
## License
|
|
137
|
+
|
|
138
|
+
[MIT](https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/LICENSE)
|
|
139
|
+
|
|
140
|
+
<!-- markdownlint-disable-file MD033 -->
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# stac-fastapi-pgstac
|
|
2
|
+
|
|
3
|
+
[](https://github.com/stac-utils/stac-fastapi-pgstac/actions/workflows/cicd.yaml)
|
|
4
|
+
[](https://pypi.org/project/stac-fastapi.pgstac)
|
|
5
|
+
[](https://stac-utils.github.io/stac-fastapi-pgstac/)
|
|
6
|
+
[](https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
<p align="center">
|
|
9
|
+
<img src="https://user-images.githubusercontent.com/10407788/174893876-7a3b5b7a-95a5-48c4-9ff2-cc408f1b6af9.png" style="vertical-align: middle; max-width: 400px; max-height: 100px;" height=100 />
|
|
10
|
+
<img src="https://fastapi.tiangolo.com/img/logo-margin/logo-teal.png" alt="FastAPI" style="vertical-align: middle; max-width: 400px; max-height: 100px;" width=200 />
|
|
11
|
+
</p>
|
|
12
|
+
|
|
13
|
+
[PgSTAC](https://github.com/stac-utils/pgstac) backend for [stac-fastapi](https://github.com/stac-utils/stac-fastapi), the [FastAPI](https://fastapi.tiangolo.com/) implementation of the [STAC API spec](https://github.com/radiantearth/stac-api-spec)
|
|
14
|
+
|
|
15
|
+
## Overview
|
|
16
|
+
|
|
17
|
+
**stac-fastapi-pgstac** is an HTTP interface built in FastAPI.
|
|
18
|
+
It validates requests and data sent to a [PgSTAC](https://github.com/stac-utils/pgstac) backend, and adds [links](https://github.com/radiantearth/stac-spec/blob/master/item-spec/item-spec.md#link-object) to the returned data.
|
|
19
|
+
All other processing and search is provided directly using PgSTAC procedural sql / plpgsql functions on the database.
|
|
20
|
+
PgSTAC stores all collection and item records as jsonb fields exactly as they come in allowing for any custom fields to be stored and retrieved transparently.
|
|
21
|
+
|
|
22
|
+
## `PgSTAC` version
|
|
23
|
+
|
|
24
|
+
`stac-fastapi-pgstac` depends on [`pgstac`](https://stac-utils.github.io/pgstac/pgstac/) database schema and [`pypgstac`](https://stac-utils.github.io/pgstac/pypgstac/) python package.
|
|
25
|
+
|
|
26
|
+
| stac-fastapi-pgstac Version | pgstac |
|
|
27
|
+
| --| --|
|
|
28
|
+
| 2.5 | >=0.7,<0.8 |
|
|
29
|
+
| 3.0 | >=0.8,<0.9 |
|
|
30
|
+
| >=4.0 | >=0.8,<0.10|
|
|
31
|
+
|
|
32
|
+
## Usage
|
|
33
|
+
|
|
34
|
+
PgSTAC is an external project and may be used by multiple front ends.
|
|
35
|
+
For Stac FastAPI development, a Docker image (which is pulled as part of the docker-compose) is available via the [Github container registry](https://github.com/stac-utils/pgstac/pkgs/container/pgstac/81689794?tag=latest).
|
|
36
|
+
The PgSTAC version required by **stac-fastapi-pgstac** is found in the [setup](http://github.com/stac-utils/stac-fastapi-pgstac/blob/main/setup.py) file.
|
|
37
|
+
|
|
38
|
+
### Sorting
|
|
39
|
+
|
|
40
|
+
While the STAC [Sort Extension](https://github.com/stac-api-extensions/sort) is fully supported, [PgSTAC](https://github.com/stac-utils/pgstac) is particularly enhanced to be able to sort by datetime (either ascending or descending).
|
|
41
|
+
Sorting by anything other than datetime (the default if no sort is specified) on very large STAC repositories without very specific query limits (ie selecting a single day date range) will not have the same performance.
|
|
42
|
+
For more than millions of records it is recommended to either set a low connection timeout on PostgreSQL or to disable use of the Sort Extension.
|
|
43
|
+
|
|
44
|
+
### Hydration
|
|
45
|
+
|
|
46
|
+
To configure **stac-fastapi-pgstac** to [hydrate search result items at the API level](https://stac-utils.github.io/pgstac/pgstac/#runtime-configurations), set the `USE_API_HYDRATE` environment variable to `true`. If `false` (default) the hydration will be done in the database.
|
|
47
|
+
|
|
48
|
+
| use_api_hydrate (API) | nohydrate (PgSTAC) | Hydration |
|
|
49
|
+
| --- | --- | --- |
|
|
50
|
+
| False | False | PgSTAC |
|
|
51
|
+
| True | True | API |
|
|
52
|
+
|
|
53
|
+
### Migrations
|
|
54
|
+
|
|
55
|
+
There is a Python utility as part of PgSTAC ([pypgstac](https://stac-utils.github.io/pgstac/pypgstac/)) that includes a migration utility.
|
|
56
|
+
To use:
|
|
57
|
+
|
|
58
|
+
```shell
|
|
59
|
+
pypgstac migrate
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Development
|
|
63
|
+
|
|
64
|
+
Install the packages in editable mode:
|
|
65
|
+
|
|
66
|
+
We recommand using [`uv`](https://docs.astral.sh/uv) as project manager for development.
|
|
67
|
+
|
|
68
|
+
See https://docs.astral.sh/uv/getting-started/installation/ for installation
|
|
69
|
+
|
|
70
|
+
```shell
|
|
71
|
+
uv sync --dev
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
To run the tests:
|
|
75
|
+
|
|
76
|
+
```shell
|
|
77
|
+
uv run pytest
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Contributing
|
|
81
|
+
|
|
82
|
+
See [CONTRIBUTING](./contributing.md) for detailed contribution instructions.
|
|
83
|
+
|
|
84
|
+
## Releasing
|
|
85
|
+
|
|
86
|
+
See [RELEASING.md](./releasing.md).
|
|
87
|
+
|
|
88
|
+
## History
|
|
89
|
+
|
|
90
|
+
**stac-fastapi-pgstac** was initially added to **stac-fastapi** by [developmentseed](https://github.com/developmentseed).
|
|
91
|
+
In April of 2023, it was removed from the core **stac-fastapi** repository and moved to its current location (<http://github.com/stac-utils/stac-fastapi-pgstac>).
|
|
92
|
+
|
|
93
|
+
## License
|
|
94
|
+
|
|
95
|
+
[MIT](https://github.com/stac-utils/stac-fastapi-pgstac/blob/main/LICENSE)
|
|
96
|
+
|
|
97
|
+
<!-- markdownlint-disable-file MD033 -->
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "stac-fastapi-pgstac"
|
|
3
|
+
description = "An implementation of STAC API based on the FastAPI framework and using the pgstac backend."
|
|
4
|
+
readme = "README.md"
|
|
5
|
+
requires-python = ">=3.9"
|
|
6
|
+
license = "MIT"
|
|
7
|
+
authors = [
|
|
8
|
+
{ name = "David Bitner", email = "david@developmentseed.org" },
|
|
9
|
+
]
|
|
10
|
+
maintainers = [
|
|
11
|
+
{ name = "David Bitner", email = "david@developmentseed.org" },
|
|
12
|
+
{ name = "Vincent Sarago", email = "vincent@developmentseed.org" },
|
|
13
|
+
{ name = "Pete Gadomski", email = "pete.gadomski@gmail.com" },
|
|
14
|
+
{ name = "Henry Rodman", email = "henry@developmentseed.org" },
|
|
15
|
+
{ name = "Jeff Albrecht", email = "geospatialjeff@gmail.com" },
|
|
16
|
+
]
|
|
17
|
+
keywords = [
|
|
18
|
+
"STAC",
|
|
19
|
+
"STAC-API",
|
|
20
|
+
"FastAPI",
|
|
21
|
+
"PgSTAC",
|
|
22
|
+
]
|
|
23
|
+
classifiers = [
|
|
24
|
+
"Intended Audience :: Developers",
|
|
25
|
+
"Intended Audience :: Information Technology",
|
|
26
|
+
"Intended Audience :: Science/Research",
|
|
27
|
+
"Programming Language :: Python :: 3.9",
|
|
28
|
+
"Programming Language :: Python :: 3.10",
|
|
29
|
+
"Programming Language :: Python :: 3.11",
|
|
30
|
+
"Programming Language :: Python :: 3.12",
|
|
31
|
+
"Programming Language :: Python :: 3.13",
|
|
32
|
+
"Programming Language :: Python :: 3.14",
|
|
33
|
+
"License :: OSI Approved :: MIT License",
|
|
34
|
+
]
|
|
35
|
+
dynamic = ["version"]
|
|
36
|
+
dependencies = [
|
|
37
|
+
"attrs",
|
|
38
|
+
"orjson",
|
|
39
|
+
"pydantic",
|
|
40
|
+
"stac-fastapi-api>=6.1,<7.0",
|
|
41
|
+
"stac-fastapi-extensions>=6.1,<7.0",
|
|
42
|
+
"stac-fastapi-types>=6.1,<7.0",
|
|
43
|
+
"asyncpg",
|
|
44
|
+
"buildpg",
|
|
45
|
+
"brotli_asgi",
|
|
46
|
+
"cql2>=0.3.6",
|
|
47
|
+
"pypgstac>=0.9,<0.10",
|
|
48
|
+
"hydraters>=0.1.3",
|
|
49
|
+
"typing_extensions>=4.9.0",
|
|
50
|
+
"jsonpatch>=1.33.0",
|
|
51
|
+
"json-merge-patch>=0.3.0",
|
|
52
|
+
"uvicorn[standard]==0.38.0",
|
|
53
|
+
]
|
|
54
|
+
|
|
55
|
+
[project.optional-dependencies]
|
|
56
|
+
validation = [
|
|
57
|
+
"stac_pydantic[validation]",
|
|
58
|
+
]
|
|
59
|
+
server = [
|
|
60
|
+
"uvicorn[standard]==0.38.0"
|
|
61
|
+
]
|
|
62
|
+
|
|
63
|
+
[dependency-groups]
|
|
64
|
+
dev = [
|
|
65
|
+
"pystac[validation]",
|
|
66
|
+
"pytest-postgresql>=7.0",
|
|
67
|
+
# ref: https://github.com/dbfixtures/pytest-postgresql/issues/1210
|
|
68
|
+
"mirakuru>=2.0,<3.0",
|
|
69
|
+
"pytest",
|
|
70
|
+
"pytest-cov",
|
|
71
|
+
"pytest-asyncio>=0.17,<1.3",
|
|
72
|
+
"pre-commit",
|
|
73
|
+
"requests",
|
|
74
|
+
"shapely",
|
|
75
|
+
"httpx",
|
|
76
|
+
"psycopg[pool,binary]==3.2.*",
|
|
77
|
+
"bump-my-version",
|
|
78
|
+
]
|
|
79
|
+
docs = [
|
|
80
|
+
"black>=23.10.1",
|
|
81
|
+
"mkdocs>=1.4.3",
|
|
82
|
+
"mkdocs-jupyter>=0.24.5",
|
|
83
|
+
"mkdocs-material[imaging]>=9.5",
|
|
84
|
+
"griffe-inherited-docstrings>=1.0.0",
|
|
85
|
+
"mkdocstrings[python]>=0.25.1",
|
|
86
|
+
]
|
|
87
|
+
|
|
88
|
+
[project.urls]
|
|
89
|
+
Homepage = 'https://github.com/stac-utils/stac-fastapi-pgstac'
|
|
90
|
+
|
|
91
|
+
[tool.hatch.version]
|
|
92
|
+
path = "stac_fastapi/pgstac/version.py"
|
|
93
|
+
|
|
94
|
+
[tool.hatch.build.targets.sdist]
|
|
95
|
+
only-include = ["stac_fastapi"]
|
|
96
|
+
|
|
97
|
+
[tool.hatch.build.targets.wheel]
|
|
98
|
+
only-include = ["stac_fastapi"]
|
|
99
|
+
|
|
100
|
+
[build-system]
|
|
101
|
+
requires = ["hatchling"]
|
|
102
|
+
build-backend = "hatchling.build"
|
|
103
|
+
|
|
104
|
+
[[tool.uv.index]]
|
|
105
|
+
name = "testpypi"
|
|
106
|
+
url = "https://test.pypi.org/simple/"
|
|
107
|
+
publish-url = "https://test.pypi.org/legacy/"
|
|
108
|
+
explicit = true
|
|
109
|
+
|
|
110
|
+
[tool.pytest.ini_options]
|
|
111
|
+
addopts = "-sv"
|
|
112
|
+
testpaths = [
|
|
113
|
+
"tests"
|
|
114
|
+
]
|
|
115
|
+
asyncio_mode = "auto"
|
|
116
|
+
|
|
117
|
+
[tool.isort]
|
|
118
|
+
profile = "black"
|
|
119
|
+
known_first_party = "stac_fastapi.pgstac"
|
|
120
|
+
known_third_party = ["stac-pydantic", "sqlalchemy", "geoalchemy2", "fastapi", "stac_fastapi"]
|
|
121
|
+
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
|
|
122
|
+
|
|
123
|
+
[tool.mypy]
|
|
124
|
+
ignore_missing_imports = true
|
|
125
|
+
namespace_packages = true
|
|
126
|
+
explicit_package_bases = true
|
|
127
|
+
exclude = ["tests", ".venv"]
|
|
128
|
+
|
|
129
|
+
[tool.ruff]
|
|
130
|
+
line-length = 90
|
|
131
|
+
|
|
132
|
+
[tool.ruff.lint]
|
|
133
|
+
select = [
|
|
134
|
+
"C",
|
|
135
|
+
"E",
|
|
136
|
+
"F",
|
|
137
|
+
"W",
|
|
138
|
+
"B",
|
|
139
|
+
]
|
|
140
|
+
ignore = [
|
|
141
|
+
"E203", # line too long, handled by black
|
|
142
|
+
"E501", # do not perform function calls in argument defaults
|
|
143
|
+
"B028", # No explicit `stacklevel` keyword argument found
|
|
144
|
+
]
|
|
145
|
+
|
|
146
|
+
[tool.bumpversion]
|
|
147
|
+
current_version = "6.1.0"
|
|
148
|
+
parse = """(?x)
|
|
149
|
+
(?P<major>\\d+)\\.
|
|
150
|
+
(?P<minor>\\d+)\\.
|
|
151
|
+
(?P<patch>\\d+)
|
|
152
|
+
(?:
|
|
153
|
+
(?P<pre_l>a|b|rc) # pre-release label
|
|
154
|
+
(?P<pre_n>\\d+) # pre-release version number
|
|
155
|
+
)? # pre-release section is optional
|
|
156
|
+
(?:
|
|
157
|
+
\\.post
|
|
158
|
+
(?P<post_n>\\d+) # post-release version number
|
|
159
|
+
)? # post-release section is optional
|
|
160
|
+
"""
|
|
161
|
+
serialize = [
|
|
162
|
+
"{major}.{minor}.{patch}.post{post_n}",
|
|
163
|
+
"{major}.{minor}.{patch}{pre_l}{pre_n}",
|
|
164
|
+
"{major}.{minor}.{patch}",
|
|
165
|
+
]
|
|
166
|
+
|
|
167
|
+
search = "{current_version}"
|
|
168
|
+
replace = "{new_version}"
|
|
169
|
+
regex = false
|
|
170
|
+
tag = false
|
|
171
|
+
commit = true
|
|
172
|
+
|
|
173
|
+
[[tool.bumpversion.files]]
|
|
174
|
+
filename = "VERSION"
|
|
175
|
+
search = "{current_version}"
|
|
176
|
+
replace = "{new_version}"
|
|
177
|
+
|
|
178
|
+
[[tool.bumpversion.files]]
|
|
179
|
+
filename = "stac_fastapi/pgstac/version.py"
|
|
180
|
+
search = '__version__ = "{current_version}"'
|
|
181
|
+
replace = '__version__ = "{new_version}"'
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"""stac_fastapi.pgstac module."""
|