stac-fastapi-elasticsearch 6.2.1__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/elasticsearch/app.py +32 -3
- stac_fastapi/elasticsearch/database_logic.py +2 -2
- stac_fastapi/elasticsearch/version.py +1 -1
- {stac_fastapi_elasticsearch-6.2.1.dist-info → stac_fastapi_elasticsearch-6.3.0.dist-info}/METADATA +44 -34
- stac_fastapi_elasticsearch-6.3.0.dist-info/RECORD +10 -0
- {stac_fastapi_elasticsearch-6.2.1.dist-info → stac_fastapi_elasticsearch-6.3.0.dist-info}/WHEEL +1 -1
- stac_fastapi_elasticsearch-6.2.1.dist-info/RECORD +0 -10
- {stac_fastapi_elasticsearch-6.2.1.dist-info → stac_fastapi_elasticsearch-6.3.0.dist-info}/entry_points.txt +0 -0
- {stac_fastapi_elasticsearch-6.2.1.dist-info → stac_fastapi_elasticsearch-6.3.0.dist-info}/top_level.txt +0 -0
|
@@ -7,7 +7,12 @@ from contextlib import asynccontextmanager
|
|
|
7
7
|
from fastapi import FastAPI
|
|
8
8
|
|
|
9
9
|
from stac_fastapi.api.app import StacApi
|
|
10
|
-
from stac_fastapi.api.models import
|
|
10
|
+
from stac_fastapi.api.models import (
|
|
11
|
+
ItemCollectionUri,
|
|
12
|
+
create_get_request_model,
|
|
13
|
+
create_post_request_model,
|
|
14
|
+
create_request_model,
|
|
15
|
+
)
|
|
11
16
|
from stac_fastapi.core.core import (
|
|
12
17
|
BulkTransactionsClient,
|
|
13
18
|
CoreClient,
|
|
@@ -38,7 +43,10 @@ from stac_fastapi.extensions.core import (
|
|
|
38
43
|
TokenPaginationExtension,
|
|
39
44
|
TransactionExtension,
|
|
40
45
|
)
|
|
46
|
+
from stac_fastapi.extensions.core.fields import FieldsConformanceClasses
|
|
41
47
|
from stac_fastapi.extensions.core.filter import FilterConformanceClasses
|
|
48
|
+
from stac_fastapi.extensions.core.query import QueryConformanceClasses
|
|
49
|
+
from stac_fastapi.extensions.core.sort import SortConformanceClasses
|
|
42
50
|
from stac_fastapi.extensions.third_party import BulkTransactionExtension
|
|
43
51
|
from stac_fastapi.sfeos_helpers.aggregation import EsAsyncBaseAggregationClient
|
|
44
52
|
from stac_fastapi.sfeos_helpers.filter import EsAsyncBaseFiltersClient
|
|
@@ -54,6 +62,7 @@ session = Session.create_from_settings(settings)
|
|
|
54
62
|
|
|
55
63
|
database_logic = DatabaseLogic()
|
|
56
64
|
|
|
65
|
+
|
|
57
66
|
filter_extension = FilterExtension(
|
|
58
67
|
client=EsAsyncBaseFiltersClient(database=database_logic)
|
|
59
68
|
)
|
|
@@ -77,8 +86,11 @@ aggregation_extension = AggregationExtension(
|
|
|
77
86
|
aggregation_extension.POST = EsAggregationExtensionPostRequest
|
|
78
87
|
aggregation_extension.GET = EsAggregationExtensionGetRequest
|
|
79
88
|
|
|
89
|
+
fields_extension = FieldsExtension()
|
|
90
|
+
fields_extension.conformance_classes.append(FieldsConformanceClasses.ITEMS)
|
|
91
|
+
|
|
80
92
|
search_extensions = [
|
|
81
|
-
|
|
93
|
+
fields_extension,
|
|
82
94
|
QueryExtension(),
|
|
83
95
|
SortExtension(),
|
|
84
96
|
TokenPaginationExtension(),
|
|
@@ -114,10 +126,26 @@ database_logic.extensions = [type(ext).__name__ for ext in extensions]
|
|
|
114
126
|
|
|
115
127
|
post_request_model = create_post_request_model(search_extensions)
|
|
116
128
|
|
|
129
|
+
items_get_request_model = create_request_model(
|
|
130
|
+
model_name="ItemCollectionUri",
|
|
131
|
+
base_model=ItemCollectionUri,
|
|
132
|
+
extensions=[
|
|
133
|
+
SortExtension(
|
|
134
|
+
conformance_classes=[SortConformanceClasses.ITEMS],
|
|
135
|
+
),
|
|
136
|
+
QueryExtension(
|
|
137
|
+
conformance_classes=[QueryConformanceClasses.ITEMS],
|
|
138
|
+
),
|
|
139
|
+
filter_extension,
|
|
140
|
+
FieldsExtension(conformance_classes=[FieldsConformanceClasses.ITEMS]),
|
|
141
|
+
],
|
|
142
|
+
request_type="GET",
|
|
143
|
+
)
|
|
144
|
+
|
|
117
145
|
app_config = {
|
|
118
146
|
"title": os.getenv("STAC_FASTAPI_TITLE", "stac-fastapi-elasticsearch"),
|
|
119
147
|
"description": os.getenv("STAC_FASTAPI_DESCRIPTION", "stac-fastapi-elasticsearch"),
|
|
120
|
-
"api_version": os.getenv("STAC_FASTAPI_VERSION", "6.
|
|
148
|
+
"api_version": os.getenv("STAC_FASTAPI_VERSION", "6.0.0"),
|
|
121
149
|
"settings": settings,
|
|
122
150
|
"extensions": extensions,
|
|
123
151
|
"client": CoreClient(
|
|
@@ -128,6 +156,7 @@ app_config = {
|
|
|
128
156
|
),
|
|
129
157
|
"search_get_request_model": create_get_request_model(search_extensions),
|
|
130
158
|
"search_post_request_model": post_request_model,
|
|
159
|
+
"items_get_request_model": items_get_request_model,
|
|
131
160
|
"route_dependencies": get_route_dependencies(),
|
|
132
161
|
}
|
|
133
162
|
|
|
@@ -17,7 +17,7 @@ from starlette.requests import Request
|
|
|
17
17
|
|
|
18
18
|
from stac_fastapi.core.base_database_logic import BaseDatabaseLogic
|
|
19
19
|
from stac_fastapi.core.serializers import CollectionSerializer, ItemSerializer
|
|
20
|
-
from stac_fastapi.core.utilities import
|
|
20
|
+
from stac_fastapi.core.utilities import bbox2polygon, get_max_limit
|
|
21
21
|
from stac_fastapi.elasticsearch.config import AsyncElasticsearchSettings
|
|
22
22
|
from stac_fastapi.elasticsearch.config import (
|
|
23
23
|
ElasticsearchSettings as SyncElasticsearchSettings,
|
|
@@ -543,7 +543,7 @@ class DatabaseLogic(BaseDatabaseLogic):
|
|
|
543
543
|
index_param = ITEM_INDICES
|
|
544
544
|
query = add_collections_to_body(collection_ids, query)
|
|
545
545
|
|
|
546
|
-
max_result_window =
|
|
546
|
+
max_result_window = get_max_limit()
|
|
547
547
|
|
|
548
548
|
size_limit = min(limit + 1, max_result_window)
|
|
549
549
|
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"""library version."""
|
|
2
|
-
__version__ = "6.
|
|
2
|
+
__version__ = "6.3.0"
|
{stac_fastapi_elasticsearch-6.2.1.dist-info → stac_fastapi_elasticsearch-6.3.0.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
2
|
-
Name:
|
|
3
|
-
Version: 6.
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: stac-fastapi-elasticsearch
|
|
3
|
+
Version: 6.3.0
|
|
4
4
|
Summary: An implementation of STAC API based on the FastAPI framework with both Elasticsearch and Opensearch.
|
|
5
5
|
Home-page: https://github.com/stac-utils/stac-fastapi-elasticsearch-opensearch
|
|
6
6
|
License: MIT
|
|
@@ -15,8 +15,8 @@ Classifier: Programming Language :: Python :: 3.13
|
|
|
15
15
|
Classifier: License :: OSI Approved :: MIT License
|
|
16
16
|
Requires-Python: >=3.9
|
|
17
17
|
Description-Content-Type: text/markdown
|
|
18
|
-
Requires-Dist: stac-fastapi-core==6.
|
|
19
|
-
Requires-Dist: sfeos-helpers==6.
|
|
18
|
+
Requires-Dist: stac-fastapi-core==6.3.0
|
|
19
|
+
Requires-Dist: sfeos-helpers==6.3.0
|
|
20
20
|
Requires-Dist: elasticsearch[async]~=8.18.0
|
|
21
21
|
Requires-Dist: uvicorn~=0.23.0
|
|
22
22
|
Requires-Dist: starlette<0.36.0,>=0.35.0
|
|
@@ -33,15 +33,6 @@ Requires-Dist: mkdocs-material~=9.0.0; extra == "docs"
|
|
|
33
33
|
Requires-Dist: pdocs~=1.2.0; extra == "docs"
|
|
34
34
|
Provides-Extra: server
|
|
35
35
|
Requires-Dist: uvicorn[standard]~=0.23.0; extra == "server"
|
|
36
|
-
Dynamic: classifier
|
|
37
|
-
Dynamic: description
|
|
38
|
-
Dynamic: description-content-type
|
|
39
|
-
Dynamic: home-page
|
|
40
|
-
Dynamic: license
|
|
41
|
-
Dynamic: provides-extra
|
|
42
|
-
Dynamic: requires-dist
|
|
43
|
-
Dynamic: requires-python
|
|
44
|
-
Dynamic: summary
|
|
45
36
|
|
|
46
37
|
# stac-fastapi-elasticsearch-opensearch
|
|
47
38
|
|
|
@@ -111,26 +102,43 @@ This project is built on the following technologies: STAC, stac-fastapi, FastAPI
|
|
|
111
102
|
|
|
112
103
|
## Table of Contents
|
|
113
104
|
|
|
114
|
-
- [
|
|
115
|
-
- [
|
|
116
|
-
- [
|
|
117
|
-
- [
|
|
118
|
-
- [
|
|
119
|
-
- [
|
|
120
|
-
- [
|
|
121
|
-
- [
|
|
122
|
-
- [
|
|
123
|
-
- [
|
|
124
|
-
- [
|
|
125
|
-
- [
|
|
126
|
-
- [
|
|
127
|
-
- [
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
- [
|
|
131
|
-
- [
|
|
132
|
-
- [
|
|
133
|
-
- [
|
|
105
|
+
- [stac-fastapi-elasticsearch-opensearch](#stac-fastapi-elasticsearch-opensearch)
|
|
106
|
+
- [Sponsors \& Supporters](#sponsors--supporters)
|
|
107
|
+
- [Project Introduction - What is SFEOS?](#project-introduction---what-is-sfeos)
|
|
108
|
+
- [Common Deployment Patterns](#common-deployment-patterns)
|
|
109
|
+
- [Technologies](#technologies)
|
|
110
|
+
- [Table of Contents](#table-of-contents)
|
|
111
|
+
- [Documentation \& Resources](#documentation--resources)
|
|
112
|
+
- [Package Structure](#package-structure)
|
|
113
|
+
- [Examples](#examples)
|
|
114
|
+
- [Performance](#performance)
|
|
115
|
+
- [Direct Response Mode](#direct-response-mode)
|
|
116
|
+
- [Quick Start](#quick-start)
|
|
117
|
+
- [Installation](#installation)
|
|
118
|
+
- [Running Locally](#running-locally)
|
|
119
|
+
- [Using Pre-built Docker Images](#using-pre-built-docker-images)
|
|
120
|
+
- [Using Docker Compose](#using-docker-compose)
|
|
121
|
+
- [Configuration Reference](#configuration-reference)
|
|
122
|
+
- [Datetime-Based Index Management](#datetime-based-index-management)
|
|
123
|
+
- [Overview](#overview)
|
|
124
|
+
- [When to Use](#when-to-use)
|
|
125
|
+
- [Configuration](#configuration)
|
|
126
|
+
- [Enabling Datetime-Based Indexing](#enabling-datetime-based-indexing)
|
|
127
|
+
- [Related Configuration Variables](#related-configuration-variables)
|
|
128
|
+
- [How Datetime-Based Indexing Works](#how-datetime-based-indexing-works)
|
|
129
|
+
- [Index and Alias Naming Convention](#index-and-alias-naming-convention)
|
|
130
|
+
- [Index Size Management](#index-size-management)
|
|
131
|
+
- [Interacting with the API](#interacting-with-the-api)
|
|
132
|
+
- [Configure the API](#configure-the-api)
|
|
133
|
+
- [Collection Pagination](#collection-pagination)
|
|
134
|
+
- [Ingesting Sample Data CLI Tool](#ingesting-sample-data-cli-tool)
|
|
135
|
+
- [Elasticsearch Mappings](#elasticsearch-mappings)
|
|
136
|
+
- [Managing Elasticsearch Indices](#managing-elasticsearch-indices)
|
|
137
|
+
- [Snapshots](#snapshots)
|
|
138
|
+
- [Reindexing](#reindexing)
|
|
139
|
+
- [Auth](#auth)
|
|
140
|
+
- [Aggregation](#aggregation)
|
|
141
|
+
- [Rate Limiting](#rate-limiting)
|
|
134
142
|
|
|
135
143
|
## Documentation & Resources
|
|
136
144
|
|
|
@@ -273,6 +281,8 @@ You can customize additional settings in your `.env` file:
|
|
|
273
281
|
| `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 |
|
|
274
282
|
| `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 |
|
|
275
283
|
| `STAC_ITEM_LIMIT` | Sets the environment variable for result limiting to SFEOS for the number of returned items and STAC collections. | `10` | Optional |
|
|
284
|
+
| `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 |
|
|
285
|
+
| `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 |
|
|
276
286
|
|
|
277
287
|
> [!NOTE]
|
|
278
288
|
> 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.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
stac_fastapi/elasticsearch/__init__.py,sha256=w_MZutYLreNV372sCuO46bPb0TngmPs4u8737ueS0wE,31
|
|
2
|
+
stac_fastapi/elasticsearch/app.py,sha256=42586pNMswKIyC-Q9Lz3hJh88Gm60ibbOsBOpbD0x50,6579
|
|
3
|
+
stac_fastapi/elasticsearch/config.py,sha256=itvPYr4TiOg9pWQrycgGaQxQ_Vc2KKP3aHdtH0OUZvw,5322
|
|
4
|
+
stac_fastapi/elasticsearch/database_logic.py,sha256=M6xIgtl3HB9p2V6wZPB6xm6cY02iYa2oG2OJRUbpA0c,58488
|
|
5
|
+
stac_fastapi/elasticsearch/version.py,sha256=rBLPQyvMDNA0PA0jXfByTouJPJn5p0wXiqmUWJMIfYc,45
|
|
6
|
+
stac_fastapi_elasticsearch-6.3.0.dist-info/METADATA,sha256=ijEkw05ul0-pg5rRfPMG0oKnXQd2iRNzvaIW4J4cSBo,36626
|
|
7
|
+
stac_fastapi_elasticsearch-6.3.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
|
|
8
|
+
stac_fastapi_elasticsearch-6.3.0.dist-info/entry_points.txt,sha256=aCKixki0LpUl64UPsPMtiNvfdyq-QsTCxVjJ54VF6Jk,82
|
|
9
|
+
stac_fastapi_elasticsearch-6.3.0.dist-info/top_level.txt,sha256=vqn-D9-HsRPTTxy0Vk_KkDmTiMES4owwBQ3ydSZYb2s,13
|
|
10
|
+
stac_fastapi_elasticsearch-6.3.0.dist-info/RECORD,,
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
stac_fastapi/elasticsearch/__init__.py,sha256=w_MZutYLreNV372sCuO46bPb0TngmPs4u8737ueS0wE,31
|
|
2
|
-
stac_fastapi/elasticsearch/app.py,sha256=vhP5jhguGI419Q7MRVJ6WBbxtDun8wcWQLIIqkP6Ilc,5662
|
|
3
|
-
stac_fastapi/elasticsearch/config.py,sha256=itvPYr4TiOg9pWQrycgGaQxQ_Vc2KKP3aHdtH0OUZvw,5322
|
|
4
|
-
stac_fastapi/elasticsearch/database_logic.py,sha256=N6HDLxr4GMIxREy4F_hESJZTUvpjCcj95c6V7di7i24,58478
|
|
5
|
-
stac_fastapi/elasticsearch/version.py,sha256=TvDysD5xP1CNnI8XDtkkz5sggBM1uuxjhZCv120q3AU,45
|
|
6
|
-
stac_fastapi_elasticsearch-6.2.1.dist-info/METADATA,sha256=MuvyyPQzwYR5iNMpET3p1Y-TALqPl6dA73U3igERncg,35411
|
|
7
|
-
stac_fastapi_elasticsearch-6.2.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
8
|
-
stac_fastapi_elasticsearch-6.2.1.dist-info/entry_points.txt,sha256=aCKixki0LpUl64UPsPMtiNvfdyq-QsTCxVjJ54VF6Jk,82
|
|
9
|
-
stac_fastapi_elasticsearch-6.2.1.dist-info/top_level.txt,sha256=vqn-D9-HsRPTTxy0Vk_KkDmTiMES4owwBQ3ydSZYb2s,13
|
|
10
|
-
stac_fastapi_elasticsearch-6.2.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|