stac-fastapi-opensearch 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.
@@ -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 create_get_request_model, create_post_request_model
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,
@@ -32,7 +37,10 @@ from stac_fastapi.extensions.core import (
32
37
  TokenPaginationExtension,
33
38
  TransactionExtension,
34
39
  )
40
+ from stac_fastapi.extensions.core.fields import FieldsConformanceClasses
35
41
  from stac_fastapi.extensions.core.filter import FilterConformanceClasses
42
+ from stac_fastapi.extensions.core.query import QueryConformanceClasses
43
+ from stac_fastapi.extensions.core.sort import SortConformanceClasses
36
44
  from stac_fastapi.extensions.third_party import BulkTransactionExtension
37
45
  from stac_fastapi.opensearch.config import OpensearchSettings
38
46
  from stac_fastapi.opensearch.database_logic import (
@@ -77,8 +85,11 @@ aggregation_extension = AggregationExtension(
77
85
  aggregation_extension.POST = EsAggregationExtensionPostRequest
78
86
  aggregation_extension.GET = EsAggregationExtensionGetRequest
79
87
 
88
+ fields_extension = FieldsExtension()
89
+ fields_extension.conformance_classes.append(FieldsConformanceClasses.ITEMS)
90
+
80
91
  search_extensions = [
81
- FieldsExtension(),
92
+ fields_extension,
82
93
  QueryExtension(),
83
94
  SortExtension(),
84
95
  TokenPaginationExtension(),
@@ -115,10 +126,26 @@ database_logic.extensions = [type(ext).__name__ for ext in extensions]
115
126
 
116
127
  post_request_model = create_post_request_model(search_extensions)
117
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
+
118
145
  app_config = {
119
146
  "title": os.getenv("STAC_FASTAPI_TITLE", "stac-fastapi-opensearch"),
120
147
  "description": os.getenv("STAC_FASTAPI_DESCRIPTION", "stac-fastapi-opensearch"),
121
- "api_version": os.getenv("STAC_FASTAPI_VERSION", "6.2.1"),
148
+ "api_version": os.getenv("STAC_FASTAPI_VERSION", "6.0.0"),
122
149
  "settings": settings,
123
150
  "extensions": extensions,
124
151
  "client": CoreClient(
@@ -129,6 +156,7 @@ app_config = {
129
156
  ),
130
157
  "search_get_request_model": create_get_request_model(search_extensions),
131
158
  "search_post_request_model": post_request_model,
159
+ "items_get_request_model": items_get_request_model,
132
160
  "route_dependencies": get_route_dependencies(),
133
161
  }
134
162
 
@@ -16,7 +16,7 @@ from starlette.requests import Request
16
16
 
17
17
  from stac_fastapi.core.base_database_logic import BaseDatabaseLogic
18
18
  from stac_fastapi.core.serializers import CollectionSerializer, ItemSerializer
19
- from stac_fastapi.core.utilities import MAX_LIMIT, bbox2polygon
19
+ from stac_fastapi.core.utilities import bbox2polygon, get_max_limit
20
20
  from stac_fastapi.extensions.core.transaction.request import (
21
21
  PartialCollection,
22
22
  PartialItem,
@@ -540,7 +540,7 @@ class DatabaseLogic(BaseDatabaseLogic):
540
540
 
541
541
  search_body["sort"] = sort if sort else DEFAULT_SORT
542
542
 
543
- max_result_window = MAX_LIMIT
543
+ max_result_window = get_max_limit()
544
544
 
545
545
  size_limit = min(limit + 1, max_result_window)
546
546
 
@@ -1,2 +1,2 @@
1
1
  """library version."""
2
- __version__ = "6.2.1"
2
+ __version__ = "6.3.0"
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.4
2
- Name: stac_fastapi_opensearch
3
- Version: 6.2.1
1
+ Metadata-Version: 2.1
2
+ Name: stac-fastapi-opensearch
3
+ Version: 6.3.0
4
4
  Summary: Opensearch stac-fastapi backend.
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.2.1
19
- Requires-Dist: sfeos-helpers==6.2.1
18
+ Requires-Dist: stac-fastapi-core==6.3.0
19
+ Requires-Dist: sfeos-helpers==6.3.0
20
20
  Requires-Dist: opensearch-py~=2.8.0
21
21
  Requires-Dist: opensearch-py[async]~=2.8.0
22
22
  Requires-Dist: uvicorn~=0.23.0
@@ -34,15 +34,6 @@ Requires-Dist: mkdocs-material~=9.0.0; extra == "docs"
34
34
  Requires-Dist: pdocs~=1.2.0; extra == "docs"
35
35
  Provides-Extra: server
36
36
  Requires-Dist: uvicorn[standard]~=0.23.0; extra == "server"
37
- Dynamic: classifier
38
- Dynamic: description
39
- Dynamic: description-content-type
40
- Dynamic: home-page
41
- Dynamic: license
42
- Dynamic: provides-extra
43
- Dynamic: requires-dist
44
- Dynamic: requires-python
45
- Dynamic: summary
46
37
 
47
38
  # stac-fastapi-elasticsearch-opensearch
48
39
 
@@ -112,26 +103,43 @@ This project is built on the following technologies: STAC, stac-fastapi, FastAPI
112
103
 
113
104
  ## Table of Contents
114
105
 
115
- - [Documentation & Resources](#documentation--resources)
116
- - [Package Structure](#package-structure)
117
- - [Examples](#examples)
118
- - [Performance](#performance)
119
- - [Quick Start](#quick-start)
120
- - [Installation](#installation)
121
- - [Running Locally](#running-locally)
122
- - [Configuration reference](#configuration-reference)
123
- - [Interacting with the API](#interacting-with-the-api)
124
- - [Configure the API](#configure-the-api)
125
- - [Collection pagination](#collection-pagination)
126
- - [Ingesting Sample Data CLI Tool](#ingesting-sample-data-cli-tool)
127
- - [Elasticsearch Mappings](#elasticsearch-mappings)
128
- - [Managing Elasticsearch Indices](#managing-elasticsearch-indices)
129
- - [Snapshots](#snapshots)
130
- - [Reindexing](#reindexing)
131
- - [Auth](#auth)
132
- - [Aggregation](#aggregation)
133
- - [Rate Limiting](#rate-limiting)
134
- - [Datetime-Based Index Management](#datetime-based-index-management)
106
+ - [stac-fastapi-elasticsearch-opensearch](#stac-fastapi-elasticsearch-opensearch)
107
+ - [Sponsors \& Supporters](#sponsors--supporters)
108
+ - [Project Introduction - What is SFEOS?](#project-introduction---what-is-sfeos)
109
+ - [Common Deployment Patterns](#common-deployment-patterns)
110
+ - [Technologies](#technologies)
111
+ - [Table of Contents](#table-of-contents)
112
+ - [Documentation \& Resources](#documentation--resources)
113
+ - [Package Structure](#package-structure)
114
+ - [Examples](#examples)
115
+ - [Performance](#performance)
116
+ - [Direct Response Mode](#direct-response-mode)
117
+ - [Quick Start](#quick-start)
118
+ - [Installation](#installation)
119
+ - [Running Locally](#running-locally)
120
+ - [Using Pre-built Docker Images](#using-pre-built-docker-images)
121
+ - [Using Docker Compose](#using-docker-compose)
122
+ - [Configuration Reference](#configuration-reference)
123
+ - [Datetime-Based Index Management](#datetime-based-index-management)
124
+ - [Overview](#overview)
125
+ - [When to Use](#when-to-use)
126
+ - [Configuration](#configuration)
127
+ - [Enabling Datetime-Based Indexing](#enabling-datetime-based-indexing)
128
+ - [Related Configuration Variables](#related-configuration-variables)
129
+ - [How Datetime-Based Indexing Works](#how-datetime-based-indexing-works)
130
+ - [Index and Alias Naming Convention](#index-and-alias-naming-convention)
131
+ - [Index Size Management](#index-size-management)
132
+ - [Interacting with the API](#interacting-with-the-api)
133
+ - [Configure the API](#configure-the-api)
134
+ - [Collection Pagination](#collection-pagination)
135
+ - [Ingesting Sample Data CLI Tool](#ingesting-sample-data-cli-tool)
136
+ - [Elasticsearch Mappings](#elasticsearch-mappings)
137
+ - [Managing Elasticsearch Indices](#managing-elasticsearch-indices)
138
+ - [Snapshots](#snapshots)
139
+ - [Reindexing](#reindexing)
140
+ - [Auth](#auth)
141
+ - [Aggregation](#aggregation)
142
+ - [Rate Limiting](#rate-limiting)
135
143
 
136
144
  ## Documentation & Resources
137
145
 
@@ -274,6 +282,8 @@ You can customize additional settings in your `.env` file:
274
282
  | `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 |
275
283
  | `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 |
276
284
  | `STAC_ITEM_LIMIT` | Sets the environment variable for result limiting to SFEOS for the number of returned items and STAC collections. | `10` | Optional |
285
+ | `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 |
286
+ | `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 |
277
287
 
278
288
  > [!NOTE]
279
289
  > 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/opensearch/__init__.py,sha256=iJWMUgn7mUvmuPQSO_FlyhJ5eDdbbfmGv1qnFOX5-qk,28
2
+ stac_fastapi/opensearch/app.py,sha256=KTXD2jdAlcrrXr1o0bRMFBJp-B3fo0F3gyY2Pcc9rMA,6558
3
+ stac_fastapi/opensearch/config.py,sha256=zGx4-4c5zEnu_Bh8Ra3SkIC83tluDiz-wKYQclRRDJA,5179
4
+ stac_fastapi/opensearch/database_logic.py,sha256=jvFsyQYmFTYkakVg6kcQt1zx-IkqmCC2093gtgNwuPQ,56024
5
+ stac_fastapi/opensearch/version.py,sha256=rBLPQyvMDNA0PA0jXfByTouJPJn5p0wXiqmUWJMIfYc,45
6
+ stac_fastapi_opensearch-6.3.0.dist-info/METADATA,sha256=B-xB5wIjNHXI9bkk5Oeg6wuK69j8nE-p529wXq8oIcw,36590
7
+ stac_fastapi_opensearch-6.3.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
8
+ stac_fastapi_opensearch-6.3.0.dist-info/entry_points.txt,sha256=zjZ0Xsr9BUNJqMkdPpl6zEIUykv1uFdJtNELFRChp0w,76
9
+ stac_fastapi_opensearch-6.3.0.dist-info/top_level.txt,sha256=vqn-D9-HsRPTTxy0Vk_KkDmTiMES4owwBQ3ydSZYb2s,13
10
+ stac_fastapi_opensearch-6.3.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.9.0)
2
+ Generator: bdist_wheel (0.45.1)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,10 +0,0 @@
1
- stac_fastapi/opensearch/__init__.py,sha256=iJWMUgn7mUvmuPQSO_FlyhJ5eDdbbfmGv1qnFOX5-qk,28
2
- stac_fastapi/opensearch/app.py,sha256=mthAxDSRPG3dNbW4j527LeDxXkbkafwKpKWKMmONhvk,5642
3
- stac_fastapi/opensearch/config.py,sha256=zGx4-4c5zEnu_Bh8Ra3SkIC83tluDiz-wKYQclRRDJA,5179
4
- stac_fastapi/opensearch/database_logic.py,sha256=zq133EM1PRp5qZKpKzAt6Xx5r_L-8sU8pCS_LTbfcSg,56014
5
- stac_fastapi/opensearch/version.py,sha256=TvDysD5xP1CNnI8XDtkkz5sggBM1uuxjhZCv120q3AU,45
6
- stac_fastapi_opensearch-6.2.1.dist-info/METADATA,sha256=FC8G7Y7_QRgmqaY4f2ikhp6fc57fBUTDR9gIg5gzS5E,35375
7
- stac_fastapi_opensearch-6.2.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
8
- stac_fastapi_opensearch-6.2.1.dist-info/entry_points.txt,sha256=zjZ0Xsr9BUNJqMkdPpl6zEIUykv1uFdJtNELFRChp0w,76
9
- stac_fastapi_opensearch-6.2.1.dist-info/top_level.txt,sha256=vqn-D9-HsRPTTxy0Vk_KkDmTiMES4owwBQ3ydSZYb2s,13
10
- stac_fastapi_opensearch-6.2.1.dist-info/RECORD,,