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.
@@ -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