stac-fastapi.api 6.0.0__tar.gz → 6.1.1__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.
Files changed (28) hide show
  1. stac_fastapi_api-6.1.1/.gitignore +135 -0
  2. stac_fastapi_api-6.1.1/PKG-INFO +22 -0
  3. stac_fastapi_api-6.1.1/pyproject.toml +64 -0
  4. {stac_fastapi_api-6.0.0 → stac_fastapi_api-6.1.1}/stac_fastapi/api/app.py +7 -4
  5. {stac_fastapi_api-6.0.0 → stac_fastapi_api-6.1.1}/stac_fastapi/api/models.py +2 -2
  6. {stac_fastapi_api-6.0.0 → stac_fastapi_api-6.1.1}/stac_fastapi/api/openapi.py +2 -1
  7. {stac_fastapi_api-6.0.0 → stac_fastapi_api-6.1.1}/stac_fastapi/api/routes.py +2 -2
  8. {stac_fastapi_api-6.0.0 → stac_fastapi_api-6.1.1}/stac_fastapi/api/version.py +1 -1
  9. stac_fastapi_api-6.0.0/PKG-INFO +0 -49
  10. stac_fastapi_api-6.0.0/setup.cfg +0 -7
  11. stac_fastapi_api-6.0.0/setup.py +0 -63
  12. stac_fastapi_api-6.0.0/stac_fastapi.api.egg-info/PKG-INFO +0 -49
  13. stac_fastapi_api-6.0.0/stac_fastapi.api.egg-info/SOURCES.txt +0 -24
  14. stac_fastapi_api-6.0.0/stac_fastapi.api.egg-info/dependency_links.txt +0 -1
  15. stac_fastapi_api-6.0.0/stac_fastapi.api.egg-info/not-zip-safe +0 -1
  16. stac_fastapi_api-6.0.0/stac_fastapi.api.egg-info/requires.txt +0 -21
  17. stac_fastapi_api-6.0.0/stac_fastapi.api.egg-info/top_level.txt +0 -1
  18. stac_fastapi_api-6.0.0/tests/test_api.py +0 -460
  19. stac_fastapi_api-6.0.0/tests/test_app.py +0 -580
  20. stac_fastapi_api-6.0.0/tests/test_app_prefix.py +0 -243
  21. stac_fastapi_api-6.0.0/tests/test_middleware.py +0 -240
  22. stac_fastapi_api-6.0.0/tests/test_models.py +0 -164
  23. {stac_fastapi_api-6.0.0 → stac_fastapi_api-6.1.1}/README.md +0 -0
  24. {stac_fastapi_api-6.0.0 → stac_fastapi_api-6.1.1}/stac_fastapi/api/__init__.py +0 -0
  25. {stac_fastapi_api-6.0.0 → stac_fastapi_api-6.1.1}/stac_fastapi/api/config.py +0 -0
  26. {stac_fastapi_api-6.0.0 → stac_fastapi_api-6.1.1}/stac_fastapi/api/errors.py +0 -0
  27. {stac_fastapi_api-6.0.0 → stac_fastapi_api-6.1.1}/stac_fastapi/api/middleware.py +0 -0
  28. {stac_fastapi_api-6.0.0 → stac_fastapi_api-6.1.1}/stac_fastapi/api/py.typed +0 -0
@@ -0,0 +1,135 @@
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
+ # pdocs
125
+ docs/api/*
126
+
127
+ # Direnv
128
+ .envrc
129
+
130
+ # Virtualenv
131
+ venv
132
+ .venv/
133
+
134
+ # IDE
135
+ .vscode
@@ -0,0 +1,22 @@
1
+ Metadata-Version: 2.4
2
+ Name: stac-fastapi-api
3
+ Version: 6.1.1
4
+ Summary: An implementation of STAC API based on the FastAPI framework.
5
+ Project-URL: Homepage, https://github.com/stac-utils/stac-fastapi
6
+ Author-email: ArturoAI <engineering@arturo.ai>
7
+ Maintainer-email: Vincent Sarago <vincent@developmentseed.org>, Jonathan Healy <jonathan.d.healy@gmail.com>, Pete Gadomski <pete.gadomski@gmail.com>, Jeff Albrecht <geospatialjeff@gmail.com>, Nathan Zimmerman <npzimmerman@gmail.com>
8
+ License-Expression: MIT
9
+ Keywords: FastAPI,STAC,STAC-API
10
+ Classifier: Intended Audience :: Developers
11
+ Classifier: Intended Audience :: Information Technology
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
20
+ Requires-Python: >=3.9
21
+ Requires-Dist: brotli-asgi
22
+ Requires-Dist: stac-fastapi-types~=6.1
@@ -0,0 +1,64 @@
1
+ [project]
2
+ name = "stac-fastapi-api"
3
+ description = "An implementation of STAC API based on the FastAPI framework."
4
+ readme = "README.md"
5
+ requires-python = ">=3.9"
6
+ license = "MIT"
7
+ authors = [
8
+ { name = "ArturoAI", email = "engineering@arturo.ai" },
9
+ ]
10
+ maintainers = [
11
+ { name = "Vincent Sarago", email = "vincent@developmentseed.org" },
12
+ { name = "Jonathan Healy", email = "jonathan.d.healy@gmail.com" },
13
+ { name = "Pete Gadomski", email = "pete.gadomski@gmail.com" },
14
+ { name = "Jeff Albrecht", email = "geospatialjeff@gmail.com" },
15
+ { name = "Nathan Zimmerman", email = "npzimmerman@gmail.com" },
16
+ ]
17
+ keywords = [
18
+ "STAC",
19
+ "STAC-API",
20
+ "FastAPI",
21
+ ]
22
+ classifiers = [
23
+ "Intended Audience :: Developers",
24
+ "Intended Audience :: Information Technology",
25
+ "Intended Audience :: Science/Research",
26
+ "Programming Language :: Python :: 3.9",
27
+ "Programming Language :: Python :: 3.10",
28
+ "Programming Language :: Python :: 3.11",
29
+ "Programming Language :: Python :: 3.12",
30
+ "Programming Language :: Python :: 3.13",
31
+ "Programming Language :: Python :: 3.14",
32
+ "License :: OSI Approved :: MIT License",
33
+ ]
34
+ dynamic = ["version"]
35
+ dependencies = [
36
+ "brotli_asgi",
37
+ "stac-fastapi.types~=6.1",
38
+ ]
39
+
40
+ [dependency-groups]
41
+ dev = [
42
+ "httpx",
43
+ "pytest",
44
+ "pytest-cov",
45
+ "pytest-asyncio",
46
+ "pytest-benchmark",
47
+ ]
48
+
49
+ [project.urls]
50
+ Homepage = 'https://github.com/stac-utils/stac-fastapi'
51
+
52
+ [tool.hatch.version]
53
+ path = "stac_fastapi/api/version.py"
54
+
55
+ [tool.hatch.build.targets.sdist]
56
+ exclude = ["tests/"]
57
+
58
+ [tool.hatch.build.targets.wheel]
59
+ only-include = ["stac_fastapi"]
60
+
61
+ [build-system]
62
+ requires = ["hatchling"]
63
+ build-backend = "hatchling.build"
64
+
@@ -1,6 +1,7 @@
1
1
  """Fastapi app creation."""
2
2
 
3
3
 
4
+ import inspect
4
5
  from typing import Awaitable, Callable, Dict, List, Optional, Tuple, Type, Union
5
6
 
6
7
  import attr
@@ -8,7 +9,6 @@ from brotli_asgi import BrotliMiddleware
8
9
  from fastapi import APIRouter, FastAPI
9
10
  from fastapi.params import Depends
10
11
  from stac_pydantic import api
11
- from stac_pydantic.api.collections import Collections
12
12
  from stac_pydantic.shared import MimeTypes
13
13
  from stac_pydantic.version import STAC_VERSION
14
14
  from starlette.middleware import Middleware
@@ -32,6 +32,7 @@ from stac_fastapi.api.routes import (
32
32
  add_direct_response,
33
33
  add_route_dependencies,
34
34
  create_async_endpoint,
35
+ sync_to_async,
35
36
  )
36
37
  from stac_fastapi.types.config import ApiSettings, Settings
37
38
  from stac_fastapi.types.core import AsyncBaseCoreClient, BaseCoreClient
@@ -277,14 +278,14 @@ class StacApi:
277
278
  name="Get Collections",
278
279
  path="/collections",
279
280
  response_model=(
280
- Collections if self.settings.enable_response_models else None
281
+ api.Collections if self.settings.enable_response_models else None
281
282
  ),
282
283
  responses={
283
284
  200: {
284
285
  "content": {
285
286
  MimeTypes.json.value: {},
286
287
  },
287
- "model": Collections,
288
+ "model": api.Collections,
288
289
  },
289
290
  },
290
291
  response_class=self.response_class,
@@ -411,7 +412,9 @@ class StacApi:
411
412
  },
412
413
  response_class=self.response_class,
413
414
  methods=["GET"],
414
- endpoint=self.health_check,
415
+ endpoint=self.health_check
416
+ if inspect.iscoroutinefunction(self.health_check)
417
+ else sync_to_async(self.health_check),
415
418
  )
416
419
  self.app.include_router(mgmt_router, tags=["Liveliness/Readiness"])
417
420
 
@@ -29,9 +29,9 @@ except ImportError: # pragma: nocover
29
29
 
30
30
  def create_request_model(
31
31
  model_name="SearchGetRequest",
32
- base_model: Union[Type[BaseModel], APIRequest] = BaseSearchGetRequest,
32
+ base_model: Union[Type[BaseModel], Type[APIRequest]] = BaseSearchGetRequest,
33
33
  extensions: Optional[List[ApiExtension]] = None,
34
- mixins: Optional[Union[List[BaseModel], List[APIRequest]]] = None,
34
+ mixins: Optional[Union[List[Type[BaseModel]], List[Type[APIRequest]]]] = None,
35
35
  request_type: Optional[str] = "GET",
36
36
  ) -> Union[Type[BaseModel], APIRequest]:
37
37
  """Create a pydantic model for validating request bodies."""
@@ -1,9 +1,10 @@
1
1
  """openapi."""
2
2
 
3
3
  from fastapi import FastAPI
4
+ from fastapi.routing import request_response
4
5
  from starlette.requests import Request
5
6
  from starlette.responses import Response
6
- from starlette.routing import Route, request_response
7
+ from starlette.routing import Route
7
8
 
8
9
 
9
10
  def update_openapi(app: FastAPI) -> FastAPI:
@@ -8,12 +8,12 @@ from typing import Any, Awaitable, Callable, Dict, List, Optional, Type, TypedDi
8
8
  from fastapi import Depends, FastAPI, params
9
9
  from fastapi.datastructures import DefaultPlaceholder
10
10
  from fastapi.dependencies.utils import get_dependant, get_parameterless_sub_dependant
11
- from fastapi.routing import APIRoute
11
+ from fastapi.routing import APIRoute, request_response
12
12
  from pydantic import BaseModel
13
13
  from starlette.concurrency import run_in_threadpool
14
14
  from starlette.requests import Request
15
15
  from starlette.responses import Response
16
- from starlette.routing import BaseRoute, Match, request_response
16
+ from starlette.routing import BaseRoute, Match
17
17
  from starlette.status import HTTP_204_NO_CONTENT
18
18
 
19
19
  from stac_fastapi.api.models import APIRequest
@@ -1,3 +1,3 @@
1
1
  """Library version."""
2
2
 
3
- __version__ = "6.0.0"
3
+ __version__ = "6.1.1"
@@ -1,49 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: stac-fastapi.api
3
- Version: 6.0.0
4
- Summary: An implementation of STAC API based on the FastAPI framework.
5
- Home-page: https://github.com/stac-utils/stac-fastapi
6
- Author: Arturo Engineering
7
- Author-email: engineering@arturo.ai
8
- License: MIT
9
- Keywords: STAC FastAPI COG
10
- Classifier: Intended Audience :: Developers
11
- Classifier: Intended Audience :: Information Technology
12
- Classifier: Intended Audience :: Science/Research
13
- Classifier: Programming Language :: Python :: 3.9
14
- Classifier: Programming Language :: Python :: 3.10
15
- Classifier: Programming Language :: Python :: 3.11
16
- Classifier: Programming Language :: Python :: 3.12
17
- Classifier: Programming Language :: Python :: 3.13
18
- Classifier: License :: OSI Approved :: MIT License
19
- Requires-Python: >=3.9
20
- Description-Content-Type: text/markdown
21
- Requires-Dist: brotli_asgi
22
- Requires-Dist: stac-fastapi.types~=6.0
23
- Provides-Extra: dev
24
- Requires-Dist: httpx; extra == "dev"
25
- Requires-Dist: pytest; extra == "dev"
26
- Requires-Dist: pytest-cov; extra == "dev"
27
- Requires-Dist: pytest-asyncio; extra == "dev"
28
- Requires-Dist: pre-commit; extra == "dev"
29
- Requires-Dist: requests; extra == "dev"
30
- Provides-Extra: benchmark
31
- Requires-Dist: pytest-benchmark; extra == "benchmark"
32
- Provides-Extra: docs
33
- Requires-Dist: black>=23.10.1; extra == "docs"
34
- Requires-Dist: mkdocs>=1.4.3; extra == "docs"
35
- Requires-Dist: mkdocs-jupyter>=0.24.5; extra == "docs"
36
- Requires-Dist: mkdocs-material[imaging]>=9.5; extra == "docs"
37
- Requires-Dist: griffe-inherited-docstrings>=1.0.0; extra == "docs"
38
- Requires-Dist: mkdocstrings[python]>=0.25.1; extra == "docs"
39
- Dynamic: author
40
- Dynamic: author-email
41
- Dynamic: classifier
42
- Dynamic: description-content-type
43
- Dynamic: home-page
44
- Dynamic: keywords
45
- Dynamic: license
46
- Dynamic: provides-extra
47
- Dynamic: requires-dist
48
- Dynamic: requires-python
49
- Dynamic: summary
@@ -1,7 +0,0 @@
1
- [metadata]
2
- version = attr: stac_fastapi.api.version.__version__
3
-
4
- [egg_info]
5
- tag_build =
6
- tag_date = 0
7
-
@@ -1,63 +0,0 @@
1
- """stac_fastapi: api module."""
2
-
3
- from setuptools import find_namespace_packages, setup
4
-
5
- with open("README.md") as f:
6
- desc = f.read()
7
-
8
- install_requires = [
9
- "brotli_asgi",
10
- "stac-fastapi.types~=6.0",
11
- ]
12
-
13
- extra_reqs = {
14
- "dev": [
15
- "httpx",
16
- "pytest",
17
- "pytest-cov",
18
- "pytest-asyncio",
19
- "pre-commit",
20
- "requests",
21
- ],
22
- "benchmark": [
23
- "pytest-benchmark",
24
- ],
25
- "docs": [
26
- "black>=23.10.1",
27
- "mkdocs>=1.4.3",
28
- "mkdocs-jupyter>=0.24.5",
29
- "mkdocs-material[imaging]>=9.5",
30
- "griffe-inherited-docstrings>=1.0.0",
31
- "mkdocstrings[python]>=0.25.1",
32
- ],
33
- }
34
-
35
-
36
- setup(
37
- name="stac-fastapi.api",
38
- description="An implementation of STAC API based on the FastAPI framework.",
39
- long_description=desc,
40
- long_description_content_type="text/markdown",
41
- python_requires=">=3.9",
42
- classifiers=[
43
- "Intended Audience :: Developers",
44
- "Intended Audience :: Information Technology",
45
- "Intended Audience :: Science/Research",
46
- "Programming Language :: Python :: 3.9",
47
- "Programming Language :: Python :: 3.10",
48
- "Programming Language :: Python :: 3.11",
49
- "Programming Language :: Python :: 3.12",
50
- "Programming Language :: Python :: 3.13",
51
- "License :: OSI Approved :: MIT License",
52
- ],
53
- keywords="STAC FastAPI COG",
54
- author="Arturo Engineering",
55
- author_email="engineering@arturo.ai",
56
- url="https://github.com/stac-utils/stac-fastapi",
57
- license="MIT",
58
- packages=find_namespace_packages(exclude=["alembic", "tests", "scripts"]),
59
- zip_safe=False,
60
- install_requires=install_requires,
61
- tests_require=extra_reqs["dev"],
62
- extras_require=extra_reqs,
63
- )
@@ -1,49 +0,0 @@
1
- Metadata-Version: 2.4
2
- Name: stac-fastapi.api
3
- Version: 6.0.0
4
- Summary: An implementation of STAC API based on the FastAPI framework.
5
- Home-page: https://github.com/stac-utils/stac-fastapi
6
- Author: Arturo Engineering
7
- Author-email: engineering@arturo.ai
8
- License: MIT
9
- Keywords: STAC FastAPI COG
10
- Classifier: Intended Audience :: Developers
11
- Classifier: Intended Audience :: Information Technology
12
- Classifier: Intended Audience :: Science/Research
13
- Classifier: Programming Language :: Python :: 3.9
14
- Classifier: Programming Language :: Python :: 3.10
15
- Classifier: Programming Language :: Python :: 3.11
16
- Classifier: Programming Language :: Python :: 3.12
17
- Classifier: Programming Language :: Python :: 3.13
18
- Classifier: License :: OSI Approved :: MIT License
19
- Requires-Python: >=3.9
20
- Description-Content-Type: text/markdown
21
- Requires-Dist: brotli_asgi
22
- Requires-Dist: stac-fastapi.types~=6.0
23
- Provides-Extra: dev
24
- Requires-Dist: httpx; extra == "dev"
25
- Requires-Dist: pytest; extra == "dev"
26
- Requires-Dist: pytest-cov; extra == "dev"
27
- Requires-Dist: pytest-asyncio; extra == "dev"
28
- Requires-Dist: pre-commit; extra == "dev"
29
- Requires-Dist: requests; extra == "dev"
30
- Provides-Extra: benchmark
31
- Requires-Dist: pytest-benchmark; extra == "benchmark"
32
- Provides-Extra: docs
33
- Requires-Dist: black>=23.10.1; extra == "docs"
34
- Requires-Dist: mkdocs>=1.4.3; extra == "docs"
35
- Requires-Dist: mkdocs-jupyter>=0.24.5; extra == "docs"
36
- Requires-Dist: mkdocs-material[imaging]>=9.5; extra == "docs"
37
- Requires-Dist: griffe-inherited-docstrings>=1.0.0; extra == "docs"
38
- Requires-Dist: mkdocstrings[python]>=0.25.1; extra == "docs"
39
- Dynamic: author
40
- Dynamic: author-email
41
- Dynamic: classifier
42
- Dynamic: description-content-type
43
- Dynamic: home-page
44
- Dynamic: keywords
45
- Dynamic: license
46
- Dynamic: provides-extra
47
- Dynamic: requires-dist
48
- Dynamic: requires-python
49
- Dynamic: summary
@@ -1,24 +0,0 @@
1
- README.md
2
- setup.cfg
3
- setup.py
4
- stac_fastapi.api.egg-info/PKG-INFO
5
- stac_fastapi.api.egg-info/SOURCES.txt
6
- stac_fastapi.api.egg-info/dependency_links.txt
7
- stac_fastapi.api.egg-info/not-zip-safe
8
- stac_fastapi.api.egg-info/requires.txt
9
- stac_fastapi.api.egg-info/top_level.txt
10
- stac_fastapi/api/__init__.py
11
- stac_fastapi/api/app.py
12
- stac_fastapi/api/config.py
13
- stac_fastapi/api/errors.py
14
- stac_fastapi/api/middleware.py
15
- stac_fastapi/api/models.py
16
- stac_fastapi/api/openapi.py
17
- stac_fastapi/api/py.typed
18
- stac_fastapi/api/routes.py
19
- stac_fastapi/api/version.py
20
- tests/test_api.py
21
- tests/test_app.py
22
- tests/test_app_prefix.py
23
- tests/test_middleware.py
24
- tests/test_models.py
@@ -1,21 +0,0 @@
1
- brotli_asgi
2
- stac-fastapi.types~=6.0
3
-
4
- [benchmark]
5
- pytest-benchmark
6
-
7
- [dev]
8
- httpx
9
- pytest
10
- pytest-cov
11
- pytest-asyncio
12
- pre-commit
13
- requests
14
-
15
- [docs]
16
- black>=23.10.1
17
- mkdocs>=1.4.3
18
- mkdocs-jupyter>=0.24.5
19
- mkdocs-material[imaging]>=9.5
20
- griffe-inherited-docstrings>=1.0.0
21
- mkdocstrings[python]>=0.25.1
@@ -1 +0,0 @@
1
- stac_fastapi