stac-fastapi-core 6.2.0__py3-none-any.whl → 6.3.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/base_database_logic.py +2 -0
- stac_fastapi/core/core.py +86 -79
- stac_fastapi/core/datetime_utils.py +4 -1
- stac_fastapi/core/serializers.py +35 -1
- stac_fastapi/core/utilities.py +9 -1
- stac_fastapi/core/version.py +1 -1
- {stac_fastapi_core-6.2.0.dist-info → stac_fastapi_core-6.3.0.dist-info}/METADATA +41 -21
- {stac_fastapi_core-6.2.0.dist-info → stac_fastapi_core-6.3.0.dist-info}/RECORD +10 -10
- {stac_fastapi_core-6.2.0.dist-info → stac_fastapi_core-6.3.0.dist-info}/WHEEL +0 -0
- {stac_fastapi_core-6.2.0.dist-info → stac_fastapi_core-6.3.0.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(
|
|
@@ -283,85 +284,63 @@ class CoreClient(AsyncBaseCoreClient):
|
|
|
283
284
|
async def item_collection(
|
|
284
285
|
self,
|
|
285
286
|
collection_id: str,
|
|
287
|
+
request: Request,
|
|
286
288
|
bbox: Optional[BBox] = None,
|
|
287
289
|
datetime: Optional[str] = None,
|
|
288
|
-
limit: Optional[int] =
|
|
290
|
+
limit: Optional[int] = None,
|
|
291
|
+
sortby: Optional[str] = None,
|
|
292
|
+
filter_expr: Optional[str] = None,
|
|
293
|
+
filter_lang: Optional[str] = None,
|
|
289
294
|
token: Optional[str] = None,
|
|
295
|
+
query: Optional[str] = None,
|
|
296
|
+
fields: Optional[List[str]] = None,
|
|
290
297
|
**kwargs,
|
|
291
298
|
) -> stac_types.ItemCollection:
|
|
292
|
-
"""
|
|
299
|
+
"""List items within a specific collection.
|
|
300
|
+
|
|
301
|
+
This endpoint delegates to ``get_search`` under the hood with
|
|
302
|
+
``collections=[collection_id]`` so that filtering, sorting and pagination
|
|
303
|
+
behave identically to the Search endpoints.
|
|
293
304
|
|
|
294
305
|
Args:
|
|
295
|
-
collection_id (str):
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
306
|
+
collection_id (str): ID of the collection to list items from.
|
|
307
|
+
request (Request): FastAPI Request object.
|
|
308
|
+
bbox (Optional[BBox]): Optional bounding box filter.
|
|
309
|
+
datetime (Optional[str]): Optional datetime or interval filter.
|
|
310
|
+
limit (Optional[int]): Optional page size. Defaults to env ``STAC_ITEM_LIMIT`` when unset.
|
|
311
|
+
sortby (Optional[str]): Optional sort specification. Accepts repeated values
|
|
312
|
+
like ``sortby=-properties.datetime`` or ``sortby=+id``. Bare fields (e.g. ``sortby=id``)
|
|
313
|
+
imply ascending order.
|
|
314
|
+
token (Optional[str]): Optional pagination token.
|
|
315
|
+
query (Optional[str]): Optional query string.
|
|
316
|
+
filter_expr (Optional[str]): Optional filter expression.
|
|
317
|
+
filter_lang (Optional[str]): Optional filter language.
|
|
318
|
+
fields (Optional[List[str]]): Fields to include or exclude from the results.
|
|
301
319
|
|
|
302
320
|
Returns:
|
|
303
|
-
ItemCollection:
|
|
304
|
-
the filter criteria and links to various resources.
|
|
321
|
+
ItemCollection: Feature collection with items, paging links, and counts.
|
|
305
322
|
|
|
306
323
|
Raises:
|
|
307
|
-
HTTPException:
|
|
308
|
-
Exception: If any error occurs while reading the items from the database.
|
|
324
|
+
HTTPException: 404 if the collection does not exist.
|
|
309
325
|
"""
|
|
310
|
-
request: Request = kwargs["request"]
|
|
311
|
-
token = request.query_params.get("token")
|
|
312
|
-
|
|
313
|
-
base_url = str(request.base_url)
|
|
314
|
-
|
|
315
|
-
collection = await self.get_collection(
|
|
316
|
-
collection_id=collection_id, request=request
|
|
317
|
-
)
|
|
318
|
-
collection_id = collection.get("id")
|
|
319
|
-
if collection_id is None:
|
|
320
|
-
raise HTTPException(status_code=404, detail="Collection not found")
|
|
321
|
-
|
|
322
|
-
search = self.database.make_search()
|
|
323
|
-
search = self.database.apply_collections_filter(
|
|
324
|
-
search=search, collection_ids=[collection_id]
|
|
325
|
-
)
|
|
326
|
-
|
|
327
326
|
try:
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
)
|
|
331
|
-
except (ValueError, TypeError) as e:
|
|
332
|
-
# Handle invalid interval formats if return_date fails
|
|
333
|
-
msg = f"Invalid interval format: {datetime}, error: {e}"
|
|
334
|
-
logger.error(msg)
|
|
335
|
-
raise HTTPException(status_code=400, detail=msg)
|
|
336
|
-
|
|
337
|
-
if bbox:
|
|
338
|
-
bbox = [float(x) for x in bbox]
|
|
339
|
-
if len(bbox) == 6:
|
|
340
|
-
bbox = [bbox[0], bbox[1], bbox[3], bbox[4]]
|
|
341
|
-
|
|
342
|
-
search = self.database.apply_bbox_filter(search=search, bbox=bbox)
|
|
327
|
+
await self.get_collection(collection_id=collection_id, request=request)
|
|
328
|
+
except Exception:
|
|
329
|
+
raise HTTPException(status_code=404, detail="Collection not found")
|
|
343
330
|
|
|
344
|
-
|
|
345
|
-
|
|
331
|
+
# Delegate directly to GET search for consistency
|
|
332
|
+
return await self.get_search(
|
|
333
|
+
request=request,
|
|
334
|
+
collections=[collection_id],
|
|
335
|
+
bbox=bbox,
|
|
336
|
+
datetime=datetime,
|
|
346
337
|
limit=limit,
|
|
347
|
-
sort=None,
|
|
348
338
|
token=token,
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
self.item_serializer.db_to_stac(item, base_url=base_url) for item in items
|
|
355
|
-
]
|
|
356
|
-
|
|
357
|
-
links = await PagingLinks(request=request, next=next_token).get_links()
|
|
358
|
-
|
|
359
|
-
return stac_types.ItemCollection(
|
|
360
|
-
type="FeatureCollection",
|
|
361
|
-
features=items,
|
|
362
|
-
links=links,
|
|
363
|
-
numReturned=len(items),
|
|
364
|
-
numMatched=maybe_count,
|
|
339
|
+
sortby=sortby,
|
|
340
|
+
query=query,
|
|
341
|
+
filter_expr=filter_expr,
|
|
342
|
+
filter_lang=filter_lang,
|
|
343
|
+
fields=fields,
|
|
365
344
|
)
|
|
366
345
|
|
|
367
346
|
async def get_item(
|
|
@@ -393,7 +372,7 @@ class CoreClient(AsyncBaseCoreClient):
|
|
|
393
372
|
ids: Optional[List[str]] = None,
|
|
394
373
|
bbox: Optional[BBox] = None,
|
|
395
374
|
datetime: Optional[str] = None,
|
|
396
|
-
limit: Optional[int] =
|
|
375
|
+
limit: Optional[int] = None,
|
|
397
376
|
query: Optional[str] = None,
|
|
398
377
|
token: Optional[str] = None,
|
|
399
378
|
fields: Optional[List[str]] = None,
|
|
@@ -426,6 +405,8 @@ class CoreClient(AsyncBaseCoreClient):
|
|
|
426
405
|
Raises:
|
|
427
406
|
HTTPException: If any error occurs while searching the catalog.
|
|
428
407
|
"""
|
|
408
|
+
limit = int(request.query_params.get("limit", os.getenv("STAC_ITEM_LIMIT", 10)))
|
|
409
|
+
|
|
429
410
|
base_args = {
|
|
430
411
|
"collections": collections,
|
|
431
412
|
"ids": ids,
|
|
@@ -443,10 +424,18 @@ class CoreClient(AsyncBaseCoreClient):
|
|
|
443
424
|
base_args["intersects"] = orjson.loads(unquote_plus(intersects))
|
|
444
425
|
|
|
445
426
|
if sortby:
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
427
|
+
parsed_sort = []
|
|
428
|
+
for raw in sortby:
|
|
429
|
+
if not isinstance(raw, str):
|
|
430
|
+
continue
|
|
431
|
+
s = raw.strip()
|
|
432
|
+
if not s:
|
|
433
|
+
continue
|
|
434
|
+
direction = "desc" if s[0] == "-" else "asc"
|
|
435
|
+
field = s[1:] if s and s[0] in "+-" else s
|
|
436
|
+
parsed_sort.append({"field": field, "direction": direction})
|
|
437
|
+
if parsed_sort:
|
|
438
|
+
base_args["sortby"] = parsed_sort
|
|
450
439
|
|
|
451
440
|
if filter_expr:
|
|
452
441
|
base_args["filter_lang"] = "cql2-json"
|
|
@@ -523,13 +512,15 @@ class CoreClient(AsyncBaseCoreClient):
|
|
|
523
512
|
|
|
524
513
|
search = self.database.apply_bbox_filter(search=search, bbox=bbox)
|
|
525
514
|
|
|
526
|
-
if search_request
|
|
515
|
+
if hasattr(search_request, "intersects") and getattr(
|
|
516
|
+
search_request, "intersects"
|
|
517
|
+
):
|
|
527
518
|
search = self.database.apply_intersects_filter(
|
|
528
|
-
search=search, intersects=search_request
|
|
519
|
+
search=search, intersects=getattr(search_request, "intersects")
|
|
529
520
|
)
|
|
530
521
|
|
|
531
|
-
if search_request
|
|
532
|
-
for field_name, expr in search_request
|
|
522
|
+
if hasattr(search_request, "query") and getattr(search_request, "query"):
|
|
523
|
+
for field_name, expr in getattr(search_request, "query").items():
|
|
533
524
|
field = "properties__" + field_name
|
|
534
525
|
for op, value in expr.items():
|
|
535
526
|
# Convert enum to string
|
|
@@ -538,9 +529,14 @@ class CoreClient(AsyncBaseCoreClient):
|
|
|
538
529
|
search=search, op=operator, field=field, value=value
|
|
539
530
|
)
|
|
540
531
|
|
|
541
|
-
#
|
|
532
|
+
# Apply CQL2 filter (support both 'filter_expr' and canonical 'filter')
|
|
533
|
+
cql2_filter = None
|
|
542
534
|
if hasattr(search_request, "filter_expr"):
|
|
543
535
|
cql2_filter = getattr(search_request, "filter_expr", None)
|
|
536
|
+
if cql2_filter is None and hasattr(search_request, "filter"):
|
|
537
|
+
cql2_filter = getattr(search_request, "filter", None)
|
|
538
|
+
|
|
539
|
+
if cql2_filter is not None:
|
|
544
540
|
try:
|
|
545
541
|
search = await self.database.apply_cql2_filter(search, cql2_filter)
|
|
546
542
|
except Exception as e:
|
|
@@ -558,19 +554,23 @@ class CoreClient(AsyncBaseCoreClient):
|
|
|
558
554
|
)
|
|
559
555
|
|
|
560
556
|
sort = None
|
|
561
|
-
if search_request
|
|
562
|
-
sort = self.database.populate_sort(search_request
|
|
557
|
+
if hasattr(search_request, "sortby") and getattr(search_request, "sortby"):
|
|
558
|
+
sort = self.database.populate_sort(getattr(search_request, "sortby"))
|
|
563
559
|
|
|
564
560
|
limit = 10
|
|
565
561
|
if search_request.limit:
|
|
566
562
|
limit = search_request.limit
|
|
567
563
|
|
|
564
|
+
# Use token from the request if the model doesn't define it
|
|
565
|
+
token_param = getattr(
|
|
566
|
+
search_request, "token", None
|
|
567
|
+
) or request.query_params.get("token")
|
|
568
568
|
items, maybe_count, next_token = await self.database.execute_search(
|
|
569
569
|
search=search,
|
|
570
570
|
limit=limit,
|
|
571
|
-
token=
|
|
571
|
+
token=token_param,
|
|
572
572
|
sort=sort,
|
|
573
|
-
collection_ids=search_request
|
|
573
|
+
collection_ids=getattr(search_request, "collections", None),
|
|
574
574
|
datetime_search=datetime_search,
|
|
575
575
|
)
|
|
576
576
|
|
|
@@ -914,7 +914,7 @@ class TransactionsClient(AsyncBaseTransactionsClient):
|
|
|
914
914
|
|
|
915
915
|
@attr.s
|
|
916
916
|
class BulkTransactionsClient(BaseBulkTransactionsClient):
|
|
917
|
-
"""A client for posting bulk transactions
|
|
917
|
+
"""A client for posting bulk transactions.
|
|
918
918
|
|
|
919
919
|
Attributes:
|
|
920
920
|
session: An instance of `Session` to use for database connection.
|
|
@@ -962,6 +962,13 @@ class BulkTransactionsClient(BaseBulkTransactionsClient):
|
|
|
962
962
|
A string indicating the number of items successfully added.
|
|
963
963
|
"""
|
|
964
964
|
request = kwargs.get("request")
|
|
965
|
+
|
|
966
|
+
if os.getenv("ENABLE_DATETIME_INDEX_FILTERING"):
|
|
967
|
+
raise HTTPException(
|
|
968
|
+
status_code=400,
|
|
969
|
+
detail="The /collections/{collection_id}/bulk_items endpoint is invalid when ENABLE_DATETIME_INDEX_FILTERING is set to true. Try using the /collections/{collection_id}/items endpoint.",
|
|
970
|
+
)
|
|
971
|
+
|
|
965
972
|
if request:
|
|
966
973
|
base_url = str(request.base_url)
|
|
967
974
|
else:
|
|
@@ -17,17 +17,20 @@ def format_datetime_range(date_str: str) -> str:
|
|
|
17
17
|
"""
|
|
18
18
|
|
|
19
19
|
def normalize(dt):
|
|
20
|
+
"""Normalize datetime string and preserve millisecond precision."""
|
|
20
21
|
dt = dt.strip()
|
|
21
22
|
if not dt or dt == "..":
|
|
22
23
|
return ".."
|
|
23
24
|
dt_obj = rfc3339_str_to_datetime(dt)
|
|
24
25
|
dt_utc = dt_obj.astimezone(timezone.utc)
|
|
25
|
-
return dt_utc.
|
|
26
|
+
return dt_utc.isoformat(timespec="milliseconds").replace("+00:00", "Z")
|
|
26
27
|
|
|
27
28
|
if not isinstance(date_str, str):
|
|
28
29
|
return "../.."
|
|
30
|
+
|
|
29
31
|
if "/" not in date_str:
|
|
30
32
|
return f"{normalize(date_str)}/{normalize(date_str)}"
|
|
33
|
+
|
|
31
34
|
try:
|
|
32
35
|
start, end = date_str.split("/", 1)
|
|
33
36
|
except Exception:
|
stac_fastapi/core/serializers.py
CHANGED
|
@@ -9,6 +9,7 @@ from starlette.requests import Request
|
|
|
9
9
|
|
|
10
10
|
from stac_fastapi.core.datetime_utils import now_to_rfc3339_str
|
|
11
11
|
from stac_fastapi.core.models.links import CollectionLinks
|
|
12
|
+
from stac_fastapi.core.utilities import get_bool_env
|
|
12
13
|
from stac_fastapi.types import stac as stac_types
|
|
13
14
|
from stac_fastapi.types.links import ItemLinks, resolve_links
|
|
14
15
|
|
|
@@ -66,6 +67,11 @@ class ItemSerializer(Serializer):
|
|
|
66
67
|
item_links = resolve_links(stac_data.get("links", []), base_url)
|
|
67
68
|
stac_data["links"] = item_links
|
|
68
69
|
|
|
70
|
+
if get_bool_env("STAC_INDEX_ASSETS"):
|
|
71
|
+
stac_data["assets"] = [
|
|
72
|
+
{"es_key": k, **v} for k, v in stac_data.get("assets", {}).items()
|
|
73
|
+
]
|
|
74
|
+
|
|
69
75
|
now = now_to_rfc3339_str()
|
|
70
76
|
if "created" not in stac_data["properties"]:
|
|
71
77
|
stac_data["properties"]["created"] = now
|
|
@@ -93,6 +99,12 @@ class ItemSerializer(Serializer):
|
|
|
93
99
|
if original_links:
|
|
94
100
|
item_links += resolve_links(original_links, base_url)
|
|
95
101
|
|
|
102
|
+
if get_bool_env("STAC_INDEX_ASSETS"):
|
|
103
|
+
assets = {a.pop("es_key"): a for a in item.get("assets", [])}
|
|
104
|
+
|
|
105
|
+
else:
|
|
106
|
+
assets = item.get("assets", {})
|
|
107
|
+
|
|
96
108
|
return stac_types.Item(
|
|
97
109
|
type="Feature",
|
|
98
110
|
stac_version=item.get("stac_version", ""),
|
|
@@ -103,7 +115,7 @@ class ItemSerializer(Serializer):
|
|
|
103
115
|
bbox=item.get("bbox", []),
|
|
104
116
|
properties=item.get("properties", {}),
|
|
105
117
|
links=item_links,
|
|
106
|
-
assets=
|
|
118
|
+
assets=assets,
|
|
107
119
|
)
|
|
108
120
|
|
|
109
121
|
|
|
@@ -128,6 +140,15 @@ class CollectionSerializer(Serializer):
|
|
|
128
140
|
collection["links"] = resolve_links(
|
|
129
141
|
collection.get("links", []), str(request.base_url)
|
|
130
142
|
)
|
|
143
|
+
|
|
144
|
+
if get_bool_env("STAC_INDEX_ASSETS"):
|
|
145
|
+
collection["assets"] = [
|
|
146
|
+
{"es_key": k, **v} for k, v in collection.get("assets", {}).items()
|
|
147
|
+
]
|
|
148
|
+
collection["item_assets"] = [
|
|
149
|
+
{"es_key": k, **v} for k, v in collection.get("item_assets", {}).items()
|
|
150
|
+
]
|
|
151
|
+
|
|
131
152
|
return collection
|
|
132
153
|
|
|
133
154
|
@classmethod
|
|
@@ -174,5 +195,18 @@ class CollectionSerializer(Serializer):
|
|
|
174
195
|
collection_links += resolve_links(original_links, str(request.base_url))
|
|
175
196
|
collection["links"] = collection_links
|
|
176
197
|
|
|
198
|
+
if get_bool_env("STAC_INDEX_ASSETS"):
|
|
199
|
+
collection["assets"] = {
|
|
200
|
+
a.pop("es_key"): a for a in collection.get("assets", [])
|
|
201
|
+
}
|
|
202
|
+
collection["item_assets"] = {
|
|
203
|
+
i.pop("es_key"): i for i in collection.get("item_assets", [])
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
else:
|
|
207
|
+
collection["assets"] = collection.get("assets", {})
|
|
208
|
+
if item_assets := collection.get("item_assets"):
|
|
209
|
+
collection["item_assets"] = item_assets
|
|
210
|
+
|
|
177
211
|
# Return the stac_types.Collection object
|
|
178
212
|
return stac_types.Collection(**collection)
|
stac_fastapi/core/utilities.py
CHANGED
|
@@ -10,7 +10,15 @@ from typing import Any, Dict, List, Optional, Set, Union
|
|
|
10
10
|
|
|
11
11
|
from stac_fastapi.types.stac import Item
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
|
|
14
|
+
def get_max_limit():
|
|
15
|
+
"""
|
|
16
|
+
Retrieve a MAX_LIMIT value from an environment variable.
|
|
17
|
+
|
|
18
|
+
Returns:
|
|
19
|
+
int: The int value parsed from the environment variable.
|
|
20
|
+
"""
|
|
21
|
+
return int(os.getenv("ENV_MAX_LIMIT", 10000))
|
|
14
22
|
|
|
15
23
|
|
|
16
24
|
def get_bool_env(name: str, default: Union[bool, str] = False) -> bool:
|
stac_fastapi/core/version.py
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""library version."""
|
|
2
|
-
__version__ = "6.
|
|
2
|
+
__version__ = "6.3.0"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: stac-fastapi-core
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.3.0
|
|
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
|
|
@@ -97,26 +97,43 @@ This project is built on the following technologies: STAC, stac-fastapi, FastAPI
|
|
|
97
97
|
|
|
98
98
|
## Table of Contents
|
|
99
99
|
|
|
100
|
-
- [
|
|
101
|
-
- [
|
|
102
|
-
- [
|
|
103
|
-
- [
|
|
104
|
-
- [
|
|
105
|
-
- [
|
|
106
|
-
- [
|
|
107
|
-
- [
|
|
108
|
-
- [
|
|
109
|
-
- [
|
|
110
|
-
- [
|
|
111
|
-
- [
|
|
112
|
-
- [
|
|
113
|
-
- [
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
- [
|
|
117
|
-
- [
|
|
118
|
-
- [
|
|
119
|
-
- [
|
|
100
|
+
- [stac-fastapi-elasticsearch-opensearch](#stac-fastapi-elasticsearch-opensearch)
|
|
101
|
+
- [Sponsors \& Supporters](#sponsors--supporters)
|
|
102
|
+
- [Project Introduction - What is SFEOS?](#project-introduction---what-is-sfeos)
|
|
103
|
+
- [Common Deployment Patterns](#common-deployment-patterns)
|
|
104
|
+
- [Technologies](#technologies)
|
|
105
|
+
- [Table of Contents](#table-of-contents)
|
|
106
|
+
- [Documentation \& Resources](#documentation--resources)
|
|
107
|
+
- [Package Structure](#package-structure)
|
|
108
|
+
- [Examples](#examples)
|
|
109
|
+
- [Performance](#performance)
|
|
110
|
+
- [Direct Response Mode](#direct-response-mode)
|
|
111
|
+
- [Quick Start](#quick-start)
|
|
112
|
+
- [Installation](#installation)
|
|
113
|
+
- [Running Locally](#running-locally)
|
|
114
|
+
- [Using Pre-built Docker Images](#using-pre-built-docker-images)
|
|
115
|
+
- [Using Docker Compose](#using-docker-compose)
|
|
116
|
+
- [Configuration Reference](#configuration-reference)
|
|
117
|
+
- [Datetime-Based Index Management](#datetime-based-index-management)
|
|
118
|
+
- [Overview](#overview)
|
|
119
|
+
- [When to Use](#when-to-use)
|
|
120
|
+
- [Configuration](#configuration)
|
|
121
|
+
- [Enabling Datetime-Based Indexing](#enabling-datetime-based-indexing)
|
|
122
|
+
- [Related Configuration Variables](#related-configuration-variables)
|
|
123
|
+
- [How Datetime-Based Indexing Works](#how-datetime-based-indexing-works)
|
|
124
|
+
- [Index and Alias Naming Convention](#index-and-alias-naming-convention)
|
|
125
|
+
- [Index Size Management](#index-size-management)
|
|
126
|
+
- [Interacting with the API](#interacting-with-the-api)
|
|
127
|
+
- [Configure the API](#configure-the-api)
|
|
128
|
+
- [Collection Pagination](#collection-pagination)
|
|
129
|
+
- [Ingesting Sample Data CLI Tool](#ingesting-sample-data-cli-tool)
|
|
130
|
+
- [Elasticsearch Mappings](#elasticsearch-mappings)
|
|
131
|
+
- [Managing Elasticsearch Indices](#managing-elasticsearch-indices)
|
|
132
|
+
- [Snapshots](#snapshots)
|
|
133
|
+
- [Reindexing](#reindexing)
|
|
134
|
+
- [Auth](#auth)
|
|
135
|
+
- [Aggregation](#aggregation)
|
|
136
|
+
- [Rate Limiting](#rate-limiting)
|
|
120
137
|
|
|
121
138
|
## Documentation & Resources
|
|
122
139
|
|
|
@@ -258,6 +275,9 @@ You can customize additional settings in your `.env` file:
|
|
|
258
275
|
| `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
276
|
| `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
277
|
| `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 |
|
|
278
|
+
| `STAC_ITEM_LIMIT` | Sets the environment variable for result limiting to SFEOS for the number of returned items and STAC collections. | `10` | Optional |
|
|
279
|
+
| `STAC_INDEX_ASSETS` | Controls if Assets are indexed when added to Elasticsearch/Opensearch. This allows asset fields to be included in search queries. | `false` | Optional |
|
|
280
|
+
| `ENV_MAX_LIMIT` | Configures the environment variable in SFEOS to override the default `MAX_LIMIT`, which controls the limit parameter for returned items and STAC collections. | `10,000` | Optional |
|
|
261
281
|
|
|
262
282
|
> [!NOTE]
|
|
263
283
|
> 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=
|
|
6
|
-
stac_fastapi/core/datetime_utils.py,sha256=
|
|
5
|
+
stac_fastapi/core/core.py,sha256=EDh387sqlXQDY-HtvbOCI26OdnYkQoy7Z5boSRIOpkw,37508
|
|
6
|
+
stac_fastapi/core/datetime_utils.py,sha256=TrTgbU7AKNC-ic4a3HptfE5XAc9tHR7uJasZyhOuwnc,2633
|
|
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
|
-
stac_fastapi/core/serializers.py,sha256
|
|
9
|
+
stac_fastapi/core/serializers.py,sha256=HU7sVSMa6w_F_qs_gdAeIFZ18GW-6t8ZHFmgI4-1uNw,7455
|
|
10
10
|
stac_fastapi/core/session.py,sha256=aXqu4LXfVbAAsChMVXd9gAhczA2bZPne6HqPeklAwMY,474
|
|
11
|
-
stac_fastapi/core/utilities.py,sha256=
|
|
12
|
-
stac_fastapi/core/version.py,sha256=
|
|
11
|
+
stac_fastapi/core/utilities.py,sha256=WbspaJey_Cs-7TrBKasdqq7yjB7vjKiU01KyJM0m8_E,7506
|
|
12
|
+
stac_fastapi/core/version.py,sha256=rBLPQyvMDNA0PA0jXfByTouJPJn5p0wXiqmUWJMIfYc,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.
|
|
22
|
-
stac_fastapi_core-6.
|
|
23
|
-
stac_fastapi_core-6.
|
|
24
|
-
stac_fastapi_core-6.
|
|
21
|
+
stac_fastapi_core-6.3.0.dist-info/METADATA,sha256=8MjuHZ6-p2MqMNvZgKKi1uGqRpKZosrBEntHxU2GSvQ,36288
|
|
22
|
+
stac_fastapi_core-6.3.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
23
|
+
stac_fastapi_core-6.3.0.dist-info/top_level.txt,sha256=vqn-D9-HsRPTTxy0Vk_KkDmTiMES4owwBQ3ydSZYb2s,13
|
|
24
|
+
stac_fastapi_core-6.3.0.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|