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.
- stac-fastapi.core-0.1.0/PKG-INFO +28 -0
- stac-fastapi.core-0.1.0/README.md +0 -0
- stac-fastapi.core-0.1.0/setup.cfg +7 -0
- stac-fastapi.core-0.1.0/setup.py +44 -0
- stac-fastapi.core-0.1.0/stac_fastapi/core/__init__.py +1 -0
- stac-fastapi.core-0.1.0/stac_fastapi/core/base_database_logic.py +54 -0
- stac-fastapi.core-0.1.0/stac_fastapi/core/base_settings.py +12 -0
- stac-fastapi.core-0.1.0/stac_fastapi/core/core.py +983 -0
- stac-fastapi.core-0.1.0/stac_fastapi/core/datetime_utils.py +14 -0
- stac-fastapi.core-0.1.0/stac_fastapi/core/extensions/__init__.py +5 -0
- stac-fastapi.core-0.1.0/stac_fastapi/core/extensions/filter.py +267 -0
- stac-fastapi.core-0.1.0/stac_fastapi/core/extensions/query.py +81 -0
- stac-fastapi.core-0.1.0/stac_fastapi/core/models/__init__.py +1 -0
- stac-fastapi.core-0.1.0/stac_fastapi/core/models/links.py +138 -0
- stac-fastapi.core-0.1.0/stac_fastapi/core/models/search.py +1 -0
- stac-fastapi.core-0.1.0/stac_fastapi/core/serializers.py +162 -0
- stac-fastapi.core-0.1.0/stac_fastapi/core/session.py +25 -0
- stac-fastapi.core-0.1.0/stac_fastapi/core/types/core.py +358 -0
- stac-fastapi.core-0.1.0/stac_fastapi/core/utilities.py +21 -0
- stac-fastapi.core-0.1.0/stac_fastapi/core/version.py +2 -0
- stac-fastapi.core-0.1.0/stac_fastapi.core.egg-info/PKG-INFO +28 -0
- stac-fastapi.core-0.1.0/stac_fastapi.core.egg-info/SOURCES.txt +25 -0
- stac-fastapi.core-0.1.0/stac_fastapi.core.egg-info/dependency_links.txt +1 -0
- stac-fastapi.core-0.1.0/stac_fastapi.core.egg-info/not-zip-safe +1 -0
- stac-fastapi.core-0.1.0/stac_fastapi.core.egg-info/requires.txt +12 -0
- 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,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
|