stac-fastapi-core 6.2.0__py3-none-any.whl → 6.2.1__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/base_database_logic.py +2 -0
- stac_fastapi/core/core.py +7 -4
- stac_fastapi/core/version.py +1 -1
- {stac_fastapi_core-6.2.0.dist-info → stac_fastapi_core-6.2.1.dist-info}/METADATA +13 -4
- {stac_fastapi_core-6.2.0.dist-info → stac_fastapi_core-6.2.1.dist-info}/RECORD +7 -7
- {stac_fastapi_core-6.2.0.dist-info → stac_fastapi_core-6.2.1.dist-info}/WHEEL +1 -1
- {stac_fastapi_core-6.2.0.dist-info → stac_fastapi_core-6.2.1.dist-info}/top_level.txt +0 -0
|
@@ -48,6 +48,7 @@ class BaseDatabaseLogic(abc.ABC):
|
|
|
48
48
|
item_id: str,
|
|
49
49
|
operations: List,
|
|
50
50
|
base_url: str,
|
|
51
|
+
create_nest: bool = False,
|
|
51
52
|
refresh: bool = True,
|
|
52
53
|
) -> Dict:
|
|
53
54
|
"""Patch a item in the database follows RF6902."""
|
|
@@ -94,6 +95,7 @@ class BaseDatabaseLogic(abc.ABC):
|
|
|
94
95
|
collection_id: str,
|
|
95
96
|
operations: List,
|
|
96
97
|
base_url: str,
|
|
98
|
+
create_nest: bool = False,
|
|
97
99
|
refresh: bool = True,
|
|
98
100
|
) -> Dict:
|
|
99
101
|
"""Patch a collection in the database follows RF6902."""
|
stac_fastapi/core/core.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"""Core client."""
|
|
2
2
|
|
|
3
3
|
import logging
|
|
4
|
+
import os
|
|
4
5
|
from datetime import datetime as datetime_type
|
|
5
6
|
from datetime import timezone
|
|
6
7
|
from enum import Enum
|
|
@@ -234,7 +235,7 @@ class CoreClient(AsyncBaseCoreClient):
|
|
|
234
235
|
"""
|
|
235
236
|
request = kwargs["request"]
|
|
236
237
|
base_url = str(request.base_url)
|
|
237
|
-
limit = int(request.query_params.get("limit", 10))
|
|
238
|
+
limit = int(request.query_params.get("limit", os.getenv("STAC_ITEM_LIMIT", 10)))
|
|
238
239
|
token = request.query_params.get("token")
|
|
239
240
|
|
|
240
241
|
collections, next_token = await self.database.get_all_collections(
|
|
@@ -285,7 +286,7 @@ class CoreClient(AsyncBaseCoreClient):
|
|
|
285
286
|
collection_id: str,
|
|
286
287
|
bbox: Optional[BBox] = None,
|
|
287
288
|
datetime: Optional[str] = None,
|
|
288
|
-
limit: Optional[int] =
|
|
289
|
+
limit: Optional[int] = None,
|
|
289
290
|
token: Optional[str] = None,
|
|
290
291
|
**kwargs,
|
|
291
292
|
) -> stac_types.ItemCollection:
|
|
@@ -295,7 +296,7 @@ class CoreClient(AsyncBaseCoreClient):
|
|
|
295
296
|
collection_id (str): The identifier of the collection to read items from.
|
|
296
297
|
bbox (Optional[BBox]): The bounding box to filter items by.
|
|
297
298
|
datetime (Optional[str]): The datetime range to filter items by.
|
|
298
|
-
limit (int): The maximum number of items to return.
|
|
299
|
+
limit (int): The maximum number of items to return.
|
|
299
300
|
token (str): A token used for pagination.
|
|
300
301
|
request (Request): The incoming request.
|
|
301
302
|
|
|
@@ -341,6 +342,7 @@ class CoreClient(AsyncBaseCoreClient):
|
|
|
341
342
|
|
|
342
343
|
search = self.database.apply_bbox_filter(search=search, bbox=bbox)
|
|
343
344
|
|
|
345
|
+
limit = int(request.query_params.get("limit", os.getenv("STAC_ITEM_LIMIT", 10)))
|
|
344
346
|
items, maybe_count, next_token = await self.database.execute_search(
|
|
345
347
|
search=search,
|
|
346
348
|
limit=limit,
|
|
@@ -393,7 +395,7 @@ class CoreClient(AsyncBaseCoreClient):
|
|
|
393
395
|
ids: Optional[List[str]] = None,
|
|
394
396
|
bbox: Optional[BBox] = None,
|
|
395
397
|
datetime: Optional[str] = None,
|
|
396
|
-
limit: Optional[int] =
|
|
398
|
+
limit: Optional[int] = None,
|
|
397
399
|
query: Optional[str] = None,
|
|
398
400
|
token: Optional[str] = None,
|
|
399
401
|
fields: Optional[List[str]] = None,
|
|
@@ -426,6 +428,7 @@ class CoreClient(AsyncBaseCoreClient):
|
|
|
426
428
|
Raises:
|
|
427
429
|
HTTPException: If any error occurs while searching the catalog.
|
|
428
430
|
"""
|
|
431
|
+
limit = int(request.query_params.get("limit", os.getenv("STAC_ITEM_LIMIT", 10)))
|
|
429
432
|
base_args = {
|
|
430
433
|
"collections": collections,
|
|
431
434
|
"ids": ids,
|
stac_fastapi/core/version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""library version."""
|
|
2
|
-
__version__ = "6.2.
|
|
2
|
+
__version__ = "6.2.1"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
2
|
-
Name:
|
|
3
|
-
Version: 6.2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: stac_fastapi_core
|
|
3
|
+
Version: 6.2.1
|
|
4
4
|
Summary: Core library for the Elasticsearch and Opensearch stac-fastapi backends.
|
|
5
5
|
Home-page: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch
|
|
6
6
|
License: MIT
|
|
@@ -18,7 +18,7 @@ Description-Content-Type: text/markdown
|
|
|
18
18
|
Requires-Dist: fastapi~=0.109.0
|
|
19
19
|
Requires-Dist: attrs>=23.2.0
|
|
20
20
|
Requires-Dist: pydantic<3.0.0,>=2.4.1
|
|
21
|
-
Requires-Dist:
|
|
21
|
+
Requires-Dist: stac_pydantic~=3.3.0
|
|
22
22
|
Requires-Dist: stac-fastapi.types==6.0.0
|
|
23
23
|
Requires-Dist: stac-fastapi.api==6.0.0
|
|
24
24
|
Requires-Dist: stac-fastapi.extensions==6.0.0
|
|
@@ -28,6 +28,14 @@ Requires-Dist: geojson-pydantic~=1.0.0
|
|
|
28
28
|
Requires-Dist: pygeofilter~=0.3.1
|
|
29
29
|
Requires-Dist: jsonschema~=4.0.0
|
|
30
30
|
Requires-Dist: slowapi~=0.1.9
|
|
31
|
+
Dynamic: classifier
|
|
32
|
+
Dynamic: description
|
|
33
|
+
Dynamic: description-content-type
|
|
34
|
+
Dynamic: home-page
|
|
35
|
+
Dynamic: license
|
|
36
|
+
Dynamic: requires-dist
|
|
37
|
+
Dynamic: requires-python
|
|
38
|
+
Dynamic: summary
|
|
31
39
|
|
|
32
40
|
# stac-fastapi-elasticsearch-opensearch
|
|
33
41
|
|
|
@@ -258,6 +266,7 @@ You can customize additional settings in your `.env` file:
|
|
|
258
266
|
| `RAISE_ON_BULK_ERROR` | Controls whether bulk insert operations raise exceptions on errors. If set to `true`, the operation will stop and raise an exception when an error occurs. If set to `false`, errors will be logged, and the operation will continue. **Note:** STAC Item and ItemCollection validation errors will always raise, regardless of this flag. | `false` | Optional |
|
|
259
267
|
| `DATABASE_REFRESH` | Controls whether database operations refresh the index immediately after changes. If set to `true`, changes will be immediately searchable. If set to `false`, changes may not be immediately visible but can improve performance for bulk operations. If set to `wait_for`, changes will wait for the next refresh cycle to become visible. | `false` | Optional |
|
|
260
268
|
| `ENABLE_TRANSACTIONS_EXTENSIONS` | Enables or disables the Transactions and Bulk Transactions API extensions. If set to `false`, the POST `/collections` route and related transaction endpoints (including bulk transaction operations) will be unavailable in the API. This is useful for deployments where mutating the catalog via the API should be prevented. | `true` | Optional |
|
|
269
|
+
| `STAC_ITEM_LIMIT` | Sets the environment variable for result limiting to SFEOS for the number of returned items and STAC collections. | `10` | Optional |
|
|
261
270
|
|
|
262
271
|
> [!NOTE]
|
|
263
272
|
> The variables `ES_HOST`, `ES_PORT`, `ES_USE_SSL`, `ES_VERIFY_CERTS` and `ES_TIMEOUT` apply to both Elasticsearch and OpenSearch backends, so there is no need to rename the key names to `OS_` even if you're using OpenSearch.
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
stac_fastapi/core/__init__.py,sha256=8izV3IWRGdXmDOK1hIPQAanbWs9EI04PJCGgqG1ZGIs,20
|
|
2
|
-
stac_fastapi/core/base_database_logic.py,sha256=
|
|
2
|
+
stac_fastapi/core/base_database_logic.py,sha256=sGeBUQ622CuId43lwHSsR_dqlIRsN-mctzZb-zVjiIU,3259
|
|
3
3
|
stac_fastapi/core/base_settings.py,sha256=R3_Sx7n5XpGMs3zAwFJD7y008WvGU_uI2xkaabm82Kg,239
|
|
4
4
|
stac_fastapi/core/basic_auth.py,sha256=RhFv3RVSHF6OaqnaaU2DO4ncJ_S5nB1q8UNpnVJJsrk,2155
|
|
5
|
-
stac_fastapi/core/core.py,sha256
|
|
5
|
+
stac_fastapi/core/core.py,sha256=-FfM60nfA55-xaFHysd9rm3NyfQ-BrMApZRf0zZoNyY,36823
|
|
6
6
|
stac_fastapi/core/datetime_utils.py,sha256=99vlw-fo0OB_aYfBHXhOkZNxrl2sKr6ZX0oR4PfIQH4,2528
|
|
7
7
|
stac_fastapi/core/rate_limit.py,sha256=Gu8dAaJReGsj1L91U6m2tflU6RahpXDRs2-AYSKoybA,1318
|
|
8
8
|
stac_fastapi/core/route_dependencies.py,sha256=hdtuMkv-zY1vg0YxiCz1aKP0SbBcORqDGEKDGgEazW8,5482
|
|
9
9
|
stac_fastapi/core/serializers.py,sha256=-DdbKYkYxmNyhuGc9UMrtFFlwiQpfxhzlog27qpMIpw,6229
|
|
10
10
|
stac_fastapi/core/session.py,sha256=aXqu4LXfVbAAsChMVXd9gAhczA2bZPne6HqPeklAwMY,474
|
|
11
11
|
stac_fastapi/core/utilities.py,sha256=xXWO5oJCNDi7_C5jPYlHZD0B-DL-FN66eEUBUSW-cXw,7296
|
|
12
|
-
stac_fastapi/core/version.py,sha256=
|
|
12
|
+
stac_fastapi/core/version.py,sha256=TvDysD5xP1CNnI8XDtkkz5sggBM1uuxjhZCv120q3AU,45
|
|
13
13
|
stac_fastapi/core/extensions/__init__.py,sha256=2MCo0UoInkgItIM8id-rbeygzn_qUOvTGfr8jFXZjHQ,167
|
|
14
14
|
stac_fastapi/core/extensions/aggregation.py,sha256=v1hUHqlYuMqfQ554g3cTp16pUyRYucQxPERbHPAFtf8,1878
|
|
15
15
|
stac_fastapi/core/extensions/fields.py,sha256=NCT5XHvfaf297eDPNaIFsIzvJnbbUTpScqF0otdx0NA,1066
|
|
@@ -18,7 +18,7 @@ stac_fastapi/core/extensions/query.py,sha256=Xmo8pfZEZKPudZEjjozv3R0wLOP0ayjC9E6
|
|
|
18
18
|
stac_fastapi/core/models/__init__.py,sha256=g-D1DiGfmC9Bg27DW9JzkN6fAvscv75wyhyiZ6NzvIk,48
|
|
19
19
|
stac_fastapi/core/models/links.py,sha256=3jk4t2wA3RGTq9_BbzFsMKvMbgDBajQy4vKZFSHt7E8,6666
|
|
20
20
|
stac_fastapi/core/models/search.py,sha256=7SgAUyzHGXBXSqB4G6cwq9FMwoAS00momb7jvBkjyow,27
|
|
21
|
-
stac_fastapi_core-6.2.
|
|
22
|
-
stac_fastapi_core-6.2.
|
|
23
|
-
stac_fastapi_core-6.2.
|
|
24
|
-
stac_fastapi_core-6.2.
|
|
21
|
+
stac_fastapi_core-6.2.1.dist-info/METADATA,sha256=Gih-ceUvVccON3HZKibcibSHlsCr0ju4TzjXj1FPwpY,35049
|
|
22
|
+
stac_fastapi_core-6.2.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
23
|
+
stac_fastapi_core-6.2.1.dist-info/top_level.txt,sha256=vqn-D9-HsRPTTxy0Vk_KkDmTiMES4owwBQ3ydSZYb2s,13
|
|
24
|
+
stac_fastapi_core-6.2.1.dist-info/RECORD,,
|
|
File without changes
|