stac-fastapi.types 3.0.3__tar.gz → 3.0.4__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 (24) hide show
  1. {stac_fastapi_types-3.0.3 → stac_fastapi_types-3.0.4}/PKG-INFO +3 -2
  2. {stac_fastapi_types-3.0.3 → stac_fastapi_types-3.0.4}/setup.py +2 -1
  3. {stac_fastapi_types-3.0.3 → stac_fastapi_types-3.0.4}/stac_fastapi/types/config.py +1 -0
  4. {stac_fastapi_types-3.0.3 → stac_fastapi_types-3.0.4}/stac_fastapi/types/core.py +31 -4
  5. {stac_fastapi_types-3.0.3 → stac_fastapi_types-3.0.4}/stac_fastapi/types/stac.py +4 -1
  6. {stac_fastapi_types-3.0.3 → stac_fastapi_types-3.0.4}/stac_fastapi/types/version.py +1 -1
  7. {stac_fastapi_types-3.0.3 → stac_fastapi_types-3.0.4}/stac_fastapi.types.egg-info/PKG-INFO +3 -2
  8. {stac_fastapi_types-3.0.3 → stac_fastapi_types-3.0.4}/stac_fastapi.types.egg-info/requires.txt +1 -1
  9. {stac_fastapi_types-3.0.3 → stac_fastapi_types-3.0.4}/README.md +0 -0
  10. {stac_fastapi_types-3.0.3 → stac_fastapi_types-3.0.4}/setup.cfg +0 -0
  11. {stac_fastapi_types-3.0.3 → stac_fastapi_types-3.0.4}/stac_fastapi/types/__init__.py +0 -0
  12. {stac_fastapi_types-3.0.3 → stac_fastapi_types-3.0.4}/stac_fastapi/types/conformance.py +0 -0
  13. {stac_fastapi_types-3.0.3 → stac_fastapi_types-3.0.4}/stac_fastapi/types/errors.py +0 -0
  14. {stac_fastapi_types-3.0.3 → stac_fastapi_types-3.0.4}/stac_fastapi/types/extension.py +0 -0
  15. {stac_fastapi_types-3.0.3 → stac_fastapi_types-3.0.4}/stac_fastapi/types/links.py +0 -0
  16. {stac_fastapi_types-3.0.3 → stac_fastapi_types-3.0.4}/stac_fastapi/types/requests.py +0 -0
  17. {stac_fastapi_types-3.0.3 → stac_fastapi_types-3.0.4}/stac_fastapi/types/rfc3339.py +0 -0
  18. {stac_fastapi_types-3.0.3 → stac_fastapi_types-3.0.4}/stac_fastapi/types/search.py +0 -0
  19. {stac_fastapi_types-3.0.3 → stac_fastapi_types-3.0.4}/stac_fastapi.types.egg-info/SOURCES.txt +0 -0
  20. {stac_fastapi_types-3.0.3 → stac_fastapi_types-3.0.4}/stac_fastapi.types.egg-info/dependency_links.txt +0 -0
  21. {stac_fastapi_types-3.0.3 → stac_fastapi_types-3.0.4}/stac_fastapi.types.egg-info/not-zip-safe +0 -0
  22. {stac_fastapi_types-3.0.3 → stac_fastapi_types-3.0.4}/stac_fastapi.types.egg-info/top_level.txt +0 -0
  23. {stac_fastapi_types-3.0.3 → stac_fastapi_types-3.0.4}/tests/test_limit.py +0 -0
  24. {stac_fastapi_types-3.0.3 → stac_fastapi_types-3.0.4}/tests/test_rfc3339.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: stac-fastapi.types
3
- Version: 3.0.3
3
+ Version: 3.0.4
4
4
  Summary: An implementation of STAC API based on the FastAPI framework.
5
5
  Home-page: https://github.com/stac-utils/stac-fastapi
6
6
  Author: Arturo Engineering
@@ -15,13 +15,14 @@ Classifier: Programming Language :: Python :: 3.9
15
15
  Classifier: Programming Language :: Python :: 3.10
16
16
  Classifier: Programming Language :: Python :: 3.11
17
17
  Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
18
19
  Classifier: License :: OSI Approved :: MIT License
19
20
  Requires-Python: >=3.8
20
21
  Description-Content-Type: text/markdown
21
22
  Requires-Dist: fastapi>=0.109.0
22
23
  Requires-Dist: attrs>=23.2.0
23
24
  Requires-Dist: pydantic-settings>=2
24
- Requires-Dist: stac_pydantic~=3.1
25
+ Requires-Dist: stac_pydantic<4.0,>=3.1.3
25
26
  Requires-Dist: iso8601<2.2.0,>=1.0.2
26
27
  Provides-Extra: dev
27
28
  Requires-Dist: pytest; extra == "dev"
@@ -9,7 +9,7 @@ install_requires = [
9
9
  "fastapi>=0.109.0",
10
10
  "attrs>=23.2.0",
11
11
  "pydantic-settings>=2",
12
- "stac_pydantic~=3.1",
12
+ "stac_pydantic>=3.1.3,<4.0",
13
13
  "iso8601>=1.0.2,<2.2.0",
14
14
  ]
15
15
 
@@ -40,6 +40,7 @@ setup(
40
40
  "Programming Language :: Python :: 3.10",
41
41
  "Programming Language :: Python :: 3.11",
42
42
  "Programming Language :: Python :: 3.12",
43
+ "Programming Language :: Python :: 3.13",
43
44
  "License :: OSI Approved :: MIT License",
44
45
  ],
45
46
  keywords="STAC FastAPI COG",
@@ -31,6 +31,7 @@ class ApiSettings(BaseSettings):
31
31
 
32
32
  openapi_url: str = "/api"
33
33
  docs_url: str = "/api.html"
34
+ root_path: str = ""
34
35
 
35
36
  model_config = SettingsConfigDict(env_file=".env", extra="allow")
36
37
 
@@ -1,6 +1,7 @@
1
1
  """Base clients."""
2
2
 
3
3
  import abc
4
+ import warnings
4
5
  from typing import Any, Dict, List, Optional, Union
5
6
  from urllib.parse import urljoin
6
7
 
@@ -8,9 +9,9 @@ import attr
8
9
  from fastapi import Request
9
10
  from geojson_pydantic.geometries import Geometry
10
11
  from stac_pydantic import Collection, Item, ItemCollection
11
- from stac_pydantic.api.version import STAC_API_VERSION
12
12
  from stac_pydantic.links import Relations
13
13
  from stac_pydantic.shared import BBox, MimeTypes
14
+ from stac_pydantic.version import STAC_VERSION
14
15
  from starlette.responses import Response
15
16
 
16
17
  from stac_fastapi.types import stac
@@ -268,7 +269,7 @@ class AsyncBaseTransactionsClient(abc.ABC):
268
269
  class LandingPageMixin(abc.ABC):
269
270
  """Create a STAC landing page (GET /)."""
270
271
 
271
- stac_version: str = attr.ib(default=STAC_API_VERSION)
272
+ stac_version: str = attr.ib(default=STAC_VERSION)
272
273
  landing_page_id: str = attr.ib(default=api_settings.stac_fastapi_landing_id)
273
274
  title: str = attr.ib(default=api_settings.stac_fastapi_title)
274
275
  description: str = attr.ib(default=api_settings.stac_fastapi_description)
@@ -341,7 +342,20 @@ class BaseCoreClient(LandingPageMixin, abc.ABC):
341
342
  factory=lambda: BASE_CONFORMANCE_CLASSES
342
343
  )
343
344
  extensions: List[ApiExtension] = attr.ib(default=attr.Factory(list))
344
- post_request_model = attr.ib(default=BaseSearchPostRequest)
345
+ post_request_model = attr.ib(default=None)
346
+
347
+ @post_request_model.validator
348
+ def _deprecate_post_model(self, attribute, value):
349
+ """Check and raise warning if `post_request_model` is set."""
350
+ if value is not None:
351
+ warnings.warn(
352
+ "`post_request_model` attribute is deprecated and will be removed in 3.1",
353
+ DeprecationWarning,
354
+ )
355
+
356
+ def __attrs_post_init__(self):
357
+ """Set default value for post_request_model."""
358
+ self.post_request_model = self.post_request_model or BaseSearchPostRequest
345
359
 
346
360
  def conformance_classes(self) -> List[str]:
347
361
  """Generate conformance classes by adding extension conformance to base
@@ -573,7 +587,20 @@ class AsyncBaseCoreClient(LandingPageMixin, abc.ABC):
573
587
  factory=lambda: BASE_CONFORMANCE_CLASSES
574
588
  )
575
589
  extensions: List[ApiExtension] = attr.ib(default=attr.Factory(list))
576
- post_request_model = attr.ib(default=BaseSearchPostRequest)
590
+ post_request_model = attr.ib(default=None)
591
+
592
+ @post_request_model.validator
593
+ def _deprecate_post_model(self, attribute, value):
594
+ """Check and raise warning if `post_request_model` is set."""
595
+ if value is not None:
596
+ warnings.warn(
597
+ "`post_request_model` attribute is deprecated and will be removed in 3.1",
598
+ DeprecationWarning,
599
+ )
600
+
601
+ def __attrs_post_init__(self):
602
+ """Set default value for post_request_model."""
603
+ self.post_request_model = self.post_request_model or BaseSearchPostRequest
577
604
 
578
605
  def conformance_classes(self) -> List[str]:
579
606
  """Generate conformance classes by adding extension conformance to base
@@ -73,7 +73,8 @@ class ItemCollection(TypedDict, total=False):
73
73
  type: Literal["FeatureCollection"]
74
74
  features: List[Item]
75
75
  links: List[Dict[str, Any]]
76
- context: Optional[Dict[str, int]]
76
+ numberMatched: Optional[int]
77
+ numberReturned: Optional[int]
77
78
 
78
79
 
79
80
  class Collections(TypedDict, total=False):
@@ -83,3 +84,5 @@ class Collections(TypedDict, total=False):
83
84
 
84
85
  collections: List[Collection]
85
86
  links: List[Dict[str, Any]]
87
+ numberMatched: Optional[int] = None
88
+ numberReturned: Optional[int] = None
@@ -1,3 +1,3 @@
1
1
  """Library version."""
2
2
 
3
- __version__ = "3.0.3"
3
+ __version__ = "3.0.4"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: stac-fastapi.types
3
- Version: 3.0.3
3
+ Version: 3.0.4
4
4
  Summary: An implementation of STAC API based on the FastAPI framework.
5
5
  Home-page: https://github.com/stac-utils/stac-fastapi
6
6
  Author: Arturo Engineering
@@ -15,13 +15,14 @@ Classifier: Programming Language :: Python :: 3.9
15
15
  Classifier: Programming Language :: Python :: 3.10
16
16
  Classifier: Programming Language :: Python :: 3.11
17
17
  Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
18
19
  Classifier: License :: OSI Approved :: MIT License
19
20
  Requires-Python: >=3.8
20
21
  Description-Content-Type: text/markdown
21
22
  Requires-Dist: fastapi>=0.109.0
22
23
  Requires-Dist: attrs>=23.2.0
23
24
  Requires-Dist: pydantic-settings>=2
24
- Requires-Dist: stac_pydantic~=3.1
25
+ Requires-Dist: stac_pydantic<4.0,>=3.1.3
25
26
  Requires-Dist: iso8601<2.2.0,>=1.0.2
26
27
  Provides-Extra: dev
27
28
  Requires-Dist: pytest; extra == "dev"
@@ -1,7 +1,7 @@
1
1
  fastapi>=0.109.0
2
2
  attrs>=23.2.0
3
3
  pydantic-settings>=2
4
- stac_pydantic~=3.1
4
+ stac_pydantic<4.0,>=3.1.3
5
5
  iso8601<2.2.0,>=1.0.2
6
6
 
7
7
  [dev]