stac-fastapi.core 0.1.0__py3-none-any.whl
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/__init__.py +1 -0
- stac_fastapi/core/base_database_logic.py +54 -0
- stac_fastapi/core/base_settings.py +12 -0
- stac_fastapi/core/core.py +983 -0
- stac_fastapi/core/datetime_utils.py +14 -0
- stac_fastapi/core/extensions/__init__.py +5 -0
- stac_fastapi/core/extensions/filter.py +267 -0
- stac_fastapi/core/extensions/query.py +81 -0
- stac_fastapi/core/models/__init__.py +1 -0
- stac_fastapi/core/models/links.py +138 -0
- stac_fastapi/core/models/search.py +1 -0
- stac_fastapi/core/serializers.py +162 -0
- stac_fastapi/core/session.py +25 -0
- stac_fastapi/core/types/core.py +358 -0
- stac_fastapi/core/utilities.py +21 -0
- stac_fastapi/core/version.py +2 -0
- stac_fastapi.core-0.1.0.dist-info/METADATA +29 -0
- stac_fastapi.core-0.1.0.dist-info/RECORD +20 -0
- stac_fastapi.core-0.1.0.dist-info/WHEEL +5 -0
- stac_fastapi.core-0.1.0.dist-info/top_level.txt +1 -0
|
@@ -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
|