sfeos-helpers 6.4.0__py3-none-any.whl → 6.5.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: sfeos-helpers
3
- Version: 6.4.0
3
+ Version: 6.5.0
4
4
  Summary: Helper 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
@@ -15,7 +15,7 @@ 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.4.0
18
+ Requires-Dist: stac-fastapi.core==6.5.0
19
19
 
20
20
  # stac-fastapi-elasticsearch-opensearch
21
21
 
@@ -85,13 +85,13 @@ This project is built on the following technologies: STAC, stac-fastapi, FastAPI
85
85
  ## Table of Contents
86
86
 
87
87
  - [stac-fastapi-elasticsearch-opensearch](#stac-fastapi-elasticsearch-opensearch)
88
- - [Sponsors \& Supporters](#sponsors--supporters)
88
+ - [Sponsors & Supporters](#sponsors--supporters)
89
89
  - [Project Introduction - What is SFEOS?](#project-introduction---what-is-sfeos)
90
90
  - [Common Deployment Patterns](#common-deployment-patterns)
91
91
  - [Technologies](#technologies)
92
92
  - [Table of Contents](#table-of-contents)
93
93
  - [Collection Search Extensions](#collection-search-extensions)
94
- - [Documentation \& Resources](#documentation--resources)
94
+ - [Documentation & Resources](#documentation--resources)
95
95
  - [Package Structure](#package-structure)
96
96
  - [Examples](#examples)
97
97
  - [Performance](#performance)
@@ -134,7 +134,11 @@ This project is built on the following technologies: STAC, stac-fastapi, FastAPI
134
134
 
135
135
  ## Collection Search Extensions
136
136
 
137
- SFEOS implements extended capabilities for the `/collections` endpoint, allowing for more powerful collection discovery:
137
+ SFEOS provides enhanced collection search capabilities through two primary routes:
138
+ - **GET/POST `/collections`**: The standard STAC endpoint with extended query parameters
139
+ - **GET/POST `/collections-search`**: A custom endpoint that supports the same parameters, created to avoid conflicts with the STAC Transactions extension if enabled (which uses POST `/collections` for collection creation)
140
+
141
+ These endpoints support advanced collection discovery features including:
138
142
 
139
143
  - **Sorting**: Sort collections by sortable fields using the `sortby` parameter
140
144
  - Example: `/collections?sortby=+id` (ascending sort by ID)
@@ -150,9 +154,26 @@ SFEOS implements extended capabilities for the `/collections` endpoint, allowing
150
154
  - Searches across multiple text fields including title, description, and keywords
151
155
  - Supports partial word matching and relevance-based sorting
152
156
 
157
+ - **Structured Filtering**: Filter collections using CQL2 expressions
158
+ - JSON format: `/collections?filter={"op":"=","args":[{"property":"id"},"sentinel-2"]}&filter-lang=cql2-json`
159
+ - Text format: `/collections?filter=id='sentinel-2'&filter-lang=cql2-text` (note: string values must be quoted)
160
+ - Advanced text format: `/collections?filter=id LIKE '%sentinel%'&filter-lang=cql2-text` (supports LIKE, BETWEEN, etc.)
161
+ - Supports both CQL2 JSON and CQL2 text formats with various operators
162
+ - Enables precise filtering on any collection property
163
+
164
+ - **Datetime Filtering**: Filter collections by their temporal extent using the `datetime` parameter
165
+ - Example: `/collections?datetime=2020-01-01T00:00:00Z/2020-12-31T23:59:59Z` (finds collections with temporal extents that overlap this range)
166
+ - Example: `/collections?datetime=2020-06-15T12:00:00Z` (finds collections whose temporal extent includes this specific time)
167
+ - Example: `/collections?datetime=2020-01-01T00:00:00Z/..` (finds collections with temporal extents that extend to or beyond January 1, 2020)
168
+ - Example: `/collections?datetime=../2020-12-31T23:59:59Z` (finds collections with temporal extents that begin on or before December 31, 2020)
169
+ - Collections are matched if their temporal extent overlaps with the provided datetime parameter
170
+ - This allows for efficient discovery of collections based on time periods
171
+
153
172
  These extensions make it easier to build user interfaces that display and navigate through collections efficiently.
154
173
 
155
- > **Configuration**: Collection search extensions can be disabled by setting the `ENABLE_COLLECTIONS_SEARCH` environment variable to `false`. By default, these extensions are enabled.
174
+ > **Configuration**: Collection search extensions (sorting, field selection, free text search, structured filtering, and datetime filtering) for the `/collections` endpoint can be disabled by setting the `ENABLE_COLLECTIONS_SEARCH` environment variable to `false`. By default, these extensions are enabled.
175
+ >
176
+ > **Configuration**: The custom `/collections-search` endpoint can be enabled by setting the `ENABLE_COLLECTIONS_SEARCH_ROUTE` environment variable to `true`. By default, this endpoint is **disabled**.
156
177
 
157
178
  > **Note**: Sorting is only available on fields that are indexed for sorting in Elasticsearch/OpenSearch. With the default mappings, you can sort on:
158
179
  > - `id` (keyword field)
@@ -163,6 +184,7 @@ These extensions make it easier to build user interfaces that display and naviga
163
184
  >
164
185
  > **Important**: Adding keyword fields to make text fields sortable can significantly increase the index size, especially for large text fields. Consider the storage implications when deciding which fields to make sortable.
165
186
 
187
+
166
188
  ## Package Structure
167
189
 
168
190
  This project is organized into several packages, each with a specific purpose:
@@ -175,7 +197,7 @@ This project is organized into several packages, each with a specific purpose:
175
197
  - Shared logic and utilities that improve code reuse between backends
176
198
 
177
199
  - **stac_fastapi_elasticsearch**: Complete implementation of the STAC API using Elasticsearch as the backend database. This package depends on both `stac_fastapi_core` and `sfeos_helpers`.
178
- -
200
+
179
201
  - **stac_fastapi_opensearch**: Complete implementation of the STAC API using OpenSearch as the backend database. This package depends on both `stac_fastapi_core` and `sfeos_helpers`.
180
202
 
181
203
  ## Examples
@@ -293,12 +315,13 @@ You can customize additional settings in your `.env` file:
293
315
  | `ENABLE_DIRECT_RESPONSE` | Enable direct response for maximum performance (disables all FastAPI dependencies, including authentication, custom status codes, and validation) | `false` | Optional |
294
316
  | `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 |
295
317
  | `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 |
296
- | `ENABLE_COLLECTIONS_SEARCH` | Enable collection search extensions (sort, fields). | `true` | Optional |
297
- | `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 |
318
+ | `ENABLE_COLLECTIONS_SEARCH` | Enable collection search extensions (sort, fields, free text search, structured filtering, and datetime filtering) on the core `/collections` endpoint. | `true` | Optional |
319
+ | `ENABLE_COLLECTIONS_SEARCH_ROUTE` | Enable the custom `/collections-search` endpoint (both GET and POST methods). When disabled, the custom endpoint will not be available, but collection search extensions will still be available on the core `/collections` endpoint if `ENABLE_COLLECTIONS_SEARCH` is true. | `false` | Optional |
320
+ | `ENABLE_TRANSACTIONS_EXTENSIONS` | Enables or disables the Transactions and Bulk Transactions API extensions. This is useful for deployments where mutating the catalog via the API should be prevented. If set to `true`, the POST `/collections` route for search will be unavailable in the API. | `true` | Optional |
298
321
  | `STAC_ITEM_LIMIT` | Sets the environment variable for result limiting to SFEOS for the number of returned items and STAC collections. | `10` | Optional |
299
322
  | `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 |
300
323
  | `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 |
301
- | `USE_DATETIME` | Configures the datetime search behavior in SFEOS. When enabled, searches both datetime field and falls back to start_datetime/end_datetime range for items with null datetime. When disabled, searches only by start_datetime/end_datetime range. | True | Optional |
324
+ | `USE_DATETIME` | Configures the datetime search behavior in SFEOS. When enabled, searches both datetime field and falls back to start_datetime/end_datetime range for items with null datetime. When disabled, searches only by start_datetime/end_datetime range. | `true` | Optional |
302
325
 
303
326
  > [!NOTE]
304
327
  > 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.
@@ -444,7 +467,6 @@ The system uses a precise naming convention:
444
467
  - `ENABLE_COLLECTIONS_SEARCH`: Set to `true` (default) to enable collection search extensions (sort, fields). Set to `false` to disable.
445
468
  - `ENABLE_TRANSACTIONS_EXTENSIONS`: Set to `true` (default) to enable transaction extensions. Set to `false` to disable.
446
469
 
447
-
448
470
  ## Collection Pagination
449
471
 
450
472
  - **Overview**: The collections route supports pagination through optional query parameters.
@@ -1,5 +1,5 @@
1
- stac_fastapi/sfeos_helpers/mappings.py,sha256=4IrI46_DRUeyry_rim2D7LnHnwQgUvMRDMnDs0Q1q14,8512
2
- stac_fastapi/sfeos_helpers/version.py,sha256=1xfRb7s1Stv055oEewNJpZn9OQUUcaJvgSzCsYLHYSQ,45
1
+ stac_fastapi/sfeos_helpers/mappings.py,sha256=u7ZHyUu3NPS_sXaflfQPSP2Yleld3jgqCG0yKcQ64w4,8600
2
+ stac_fastapi/sfeos_helpers/version.py,sha256=KQjuGSR03-CXgF6wsaZ8qsni161S2BjhOn3wTX8JAMw,45
3
3
  stac_fastapi/sfeos_helpers/aggregation/__init__.py,sha256=Mym17lFh90by1GnoQgMyIKAqRNJnvCgVSXDYzjBiPQk,1210
4
4
  stac_fastapi/sfeos_helpers/aggregation/client.py,sha256=PPUk0kAZnms46FlLGrR5w8wa52vG-dT6BG37896R5CY,17939
5
5
  stac_fastapi/sfeos_helpers/aggregation/format.py,sha256=qUW1jjh2EEjy-V7riliFR77grpi-AgsTmP76z60K5Lo,2011
@@ -11,7 +11,7 @@ stac_fastapi/sfeos_helpers/database/mapping.py,sha256=4-MSd4xH5wg7yoC4aPjzYMDSEv
11
11
  stac_fastapi/sfeos_helpers/database/query.py,sha256=g2iGdfgqpx6o8GoQJBMl3AMmqcbSf792qvKWfWipR5w,4193
12
12
  stac_fastapi/sfeos_helpers/database/utils.py,sha256=9zU9hEglZb6f-uxOhd95saSw2id9w5PR36dWtyfXTb0,8757
13
13
  stac_fastapi/sfeos_helpers/filter/__init__.py,sha256=n3zL_MhEGOoxMz1KeijyK_UKiZ0MKPl90zHtYI5RAy8,1557
14
- stac_fastapi/sfeos_helpers/filter/client.py,sha256=tCfqI2IBgJKF0U_0yuxjiSDLBllCqNCMcHASP4-icsA,4348
14
+ stac_fastapi/sfeos_helpers/filter/client.py,sha256=QQ6gnUEMqzS_qG8G5QHcX9x3LNk5JvCp1rRJltMTmM4,4414
15
15
  stac_fastapi/sfeos_helpers/filter/cql2.py,sha256=Cg9kRYD9CVkVSyRqOyB5oVXmlyteSn2bw88sqklGpUM,955
16
16
  stac_fastapi/sfeos_helpers/filter/transform.py,sha256=1GEWQSp-rbq7_1nDVv1ApDbWxt8DswJWxwaxzV85gj4,4644
17
17
  stac_fastapi/sfeos_helpers/models/patch.py,sha256=s5n85ktnH6M2SMqpqyItR8uLxliXmnSTg1WO0QLVsmI,3127
@@ -26,7 +26,7 @@ stac_fastapi/sfeos_helpers/search_engine/selection/base.py,sha256=106c4FK50cgMmT
26
26
  stac_fastapi/sfeos_helpers/search_engine/selection/cache_manager.py,sha256=5yrgf9JA4mgRNMPDKih6xySF8mD724lEWnXhWud7m2c,4039
27
27
  stac_fastapi/sfeos_helpers/search_engine/selection/factory.py,sha256=vbgNVCUW2lviePqzpgsPLxp6IEqcX3GHiahqN2oVObA,1305
28
28
  stac_fastapi/sfeos_helpers/search_engine/selection/selectors.py,sha256=q83nfCfNfLUqtkHpORwNHNRU9Pa-heeaDIPO0RlHb-8,4779
29
- sfeos_helpers-6.4.0.dist-info/METADATA,sha256=4sXPxujytzGybiTskfZKq3E3HO9HaZriDLuw0FUypgE,38928
30
- sfeos_helpers-6.4.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
31
- sfeos_helpers-6.4.0.dist-info/top_level.txt,sha256=vqn-D9-HsRPTTxy0Vk_KkDmTiMES4owwBQ3ydSZYb2s,13
32
- sfeos_helpers-6.4.0.dist-info/RECORD,,
29
+ sfeos_helpers-6.5.0.dist-info/METADATA,sha256=aXIIszjO6RrdldIyDlS5XQUg4-c8mTfk14yLhpd0KC4,41326
30
+ sfeos_helpers-6.5.0.dist-info/WHEEL,sha256=tZoeGjtWxWRfdplE7E3d45VPlLNQnvbKiYnx7gwAy8A,92
31
+ sfeos_helpers-6.5.0.dist-info/top_level.txt,sha256=vqn-D9-HsRPTTxy0Vk_KkDmTiMES4owwBQ3ydSZYb2s,13
32
+ sfeos_helpers-6.5.0.dist-info/RECORD,,
@@ -72,7 +72,9 @@ class EsAsyncBaseFiltersClient(AsyncBaseFiltersClient):
72
72
  field_properties = field_def.get("properties")
73
73
  if field_properties:
74
74
  stack.extend(
75
- (f"{field_fqn}.{k}", v) for k, v in field_properties.items()
75
+ (f"{field_fqn}.{k}", v)
76
+ for k, v in field_properties.items()
77
+ if v.get("enabled", True)
76
78
  )
77
79
 
78
80
  # Skip non-indexed or disabled fields
@@ -161,7 +161,10 @@ ES_COLLECTIONS_MAPPINGS = {
161
161
  "properties": {
162
162
  "id": {"type": "keyword"},
163
163
  "extent.spatial.bbox": {"type": "long"},
164
- "extent.temporal.interval": {"type": "date"},
164
+ "extent.temporal.interval": {
165
+ "type": "date",
166
+ "format": "strict_date_optional_time||epoch_millis",
167
+ },
165
168
  "providers": {"type": "object", "enabled": False},
166
169
  "links": {"type": "object", "enabled": False},
167
170
  "item_assets": {"type": "object", "enabled": get_bool_env("STAC_INDEX_ASSETS")},
@@ -1,2 +1,2 @@
1
1
  """library version."""
2
- __version__ = "6.4.0"
2
+ __version__ = "6.5.0"