stac-fastapi.core 0.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.
Files changed (26) hide show
  1. stac-fastapi.core-0.1.0/PKG-INFO +28 -0
  2. stac-fastapi.core-0.1.0/README.md +0 -0
  3. stac-fastapi.core-0.1.0/setup.cfg +7 -0
  4. stac-fastapi.core-0.1.0/setup.py +44 -0
  5. stac-fastapi.core-0.1.0/stac_fastapi/core/__init__.py +1 -0
  6. stac-fastapi.core-0.1.0/stac_fastapi/core/base_database_logic.py +54 -0
  7. stac-fastapi.core-0.1.0/stac_fastapi/core/base_settings.py +12 -0
  8. stac-fastapi.core-0.1.0/stac_fastapi/core/core.py +983 -0
  9. stac-fastapi.core-0.1.0/stac_fastapi/core/datetime_utils.py +14 -0
  10. stac-fastapi.core-0.1.0/stac_fastapi/core/extensions/__init__.py +5 -0
  11. stac-fastapi.core-0.1.0/stac_fastapi/core/extensions/filter.py +267 -0
  12. stac-fastapi.core-0.1.0/stac_fastapi/core/extensions/query.py +81 -0
  13. stac-fastapi.core-0.1.0/stac_fastapi/core/models/__init__.py +1 -0
  14. stac-fastapi.core-0.1.0/stac_fastapi/core/models/links.py +138 -0
  15. stac-fastapi.core-0.1.0/stac_fastapi/core/models/search.py +1 -0
  16. stac-fastapi.core-0.1.0/stac_fastapi/core/serializers.py +162 -0
  17. stac-fastapi.core-0.1.0/stac_fastapi/core/session.py +25 -0
  18. stac-fastapi.core-0.1.0/stac_fastapi/core/types/core.py +358 -0
  19. stac-fastapi.core-0.1.0/stac_fastapi/core/utilities.py +21 -0
  20. stac-fastapi.core-0.1.0/stac_fastapi/core/version.py +2 -0
  21. stac-fastapi.core-0.1.0/stac_fastapi.core.egg-info/PKG-INFO +28 -0
  22. stac-fastapi.core-0.1.0/stac_fastapi.core.egg-info/SOURCES.txt +25 -0
  23. stac-fastapi.core-0.1.0/stac_fastapi.core.egg-info/dependency_links.txt +1 -0
  24. stac-fastapi.core-0.1.0/stac_fastapi.core.egg-info/not-zip-safe +1 -0
  25. stac-fastapi.core-0.1.0/stac_fastapi.core.egg-info/requires.txt +12 -0
  26. stac-fastapi.core-0.1.0/stac_fastapi.core.egg-info/top_level.txt +2 -0
@@ -0,0 +1,28 @@
1
+ Metadata-Version: 2.1
2
+ Name: stac-fastapi.core
3
+ Version: 0.1.0
4
+ Summary: Core library for the Elasticsearch and Opensearch stac-fastapi backends.
5
+ Home-page: https://github.com/stac-utils/stac-fastapi-elasticsearch
6
+ License: MIT
7
+ Classifier: Intended Audience :: Developers
8
+ Classifier: Intended Audience :: Information Technology
9
+ Classifier: Intended Audience :: Science/Research
10
+ Classifier: Programming Language :: Python :: 3.8
11
+ Classifier: Programming Language :: Python :: 3.9
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Requires-Python: >=3.8
16
+ Description-Content-Type: text/markdown
17
+ Requires-Dist: fastapi
18
+ Requires-Dist: attrs
19
+ Requires-Dist: pydantic[dotenv]<2
20
+ Requires-Dist: stac_pydantic==2.0.*
21
+ Requires-Dist: stac-fastapi.types==2.4.9
22
+ Requires-Dist: stac-fastapi.api==2.4.9
23
+ Requires-Dist: stac-fastapi.extensions==2.4.9
24
+ Requires-Dist: pystac[validation]
25
+ Requires-Dist: orjson
26
+ Requires-Dist: overrides
27
+ Requires-Dist: geojson-pydantic
28
+ Requires-Dist: pygeofilter==0.2.1
File without changes
@@ -0,0 +1,7 @@
1
+ [metadata]
2
+ version = 0.1.0
3
+
4
+ [egg_info]
5
+ tag_build =
6
+ tag_date = 0
7
+
@@ -0,0 +1,44 @@
1
+ """stac_fastapi: core elasticsearch/ opensearch 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
+ "fastapi",
10
+ "attrs",
11
+ "pydantic[dotenv]<2",
12
+ "stac_pydantic==2.0.*",
13
+ "stac-fastapi.types==2.4.9",
14
+ "stac-fastapi.api==2.4.9",
15
+ "stac-fastapi.extensions==2.4.9",
16
+ "pystac[validation]",
17
+ "orjson",
18
+ "overrides",
19
+ "geojson-pydantic",
20
+ "pygeofilter==0.2.1",
21
+ ]
22
+
23
+ setup(
24
+ name="stac-fastapi.core",
25
+ description="Core library for the Elasticsearch and Opensearch stac-fastapi backends.",
26
+ long_description=desc,
27
+ long_description_content_type="text/markdown",
28
+ python_requires=">=3.8",
29
+ classifiers=[
30
+ "Intended Audience :: Developers",
31
+ "Intended Audience :: Information Technology",
32
+ "Intended Audience :: Science/Research",
33
+ "Programming Language :: Python :: 3.8",
34
+ "Programming Language :: Python :: 3.9",
35
+ "Programming Language :: Python :: 3.10",
36
+ "Programming Language :: Python :: 3.11",
37
+ "License :: OSI Approved :: MIT License",
38
+ ],
39
+ url="https://github.com/stac-utils/stac-fastapi-elasticsearch",
40
+ license="MIT",
41
+ packages=find_namespace_packages(),
42
+ zip_safe=False,
43
+ install_requires=install_requires,
44
+ )
@@ -0,0 +1 @@
1
+ """Core library."""
@@ -0,0 +1,54 @@
1
+ """Base database logic."""
2
+
3
+ import abc
4
+ from typing import Any, Dict, Iterable, Optional
5
+
6
+
7
+ class BaseDatabaseLogic(abc.ABC):
8
+ """
9
+ Abstract base class for database logic.
10
+
11
+ This class defines the basic structure and operations for database interactions.
12
+ Subclasses must provide implementations for these methods.
13
+ """
14
+
15
+ @abc.abstractmethod
16
+ async def get_all_collections(
17
+ self, token: Optional[str], limit: int
18
+ ) -> Iterable[Dict[str, Any]]:
19
+ """Retrieve a list of all collections from the database."""
20
+ pass
21
+
22
+ @abc.abstractmethod
23
+ async def get_one_item(self, collection_id: str, item_id: str) -> Dict:
24
+ """Retrieve a single item from the database."""
25
+ pass
26
+
27
+ @abc.abstractmethod
28
+ async def create_item(self, item: Dict, refresh: bool = False) -> None:
29
+ """Create an item in the database."""
30
+ pass
31
+
32
+ @abc.abstractmethod
33
+ async def delete_item(
34
+ self, item_id: str, collection_id: str, refresh: bool = False
35
+ ) -> None:
36
+ """Delete an item from the database."""
37
+ pass
38
+
39
+ @abc.abstractmethod
40
+ async def create_collection(self, collection: Dict, refresh: bool = False) -> None:
41
+ """Create a collection in the database."""
42
+ pass
43
+
44
+ @abc.abstractmethod
45
+ async def find_collection(self, collection_id: str) -> Dict:
46
+ """Find a collection in the database."""
47
+ pass
48
+
49
+ @abc.abstractmethod
50
+ async def delete_collection(
51
+ self, collection_id: str, refresh: bool = False
52
+ ) -> None:
53
+ """Delete a collection from the database."""
54
+ pass
@@ -0,0 +1,12 @@
1
+ """Base settings."""
2
+
3
+ from abc import ABC, abstractmethod
4
+
5
+
6
+ class ApiBaseSettings(ABC):
7
+ """Abstract base class for API settings."""
8
+
9
+ @abstractmethod
10
+ def create_client(self):
11
+ """Create a database client."""
12
+ pass