Skip to main content

CLI tools for managing stac-fastapi-elasticsearch-opensearch deployments

Project description

SFEOS Tools

CLI tools for managing stac-fastapi-elasticsearch-opensearch deployments.

Downloads GitHub contributors GitHub stars GitHub forks PyPI version STAC

Table of Contents

Installation

For Elasticsearch

pip install sfeos-tools[elasticsearch]

Or for local development:

pip install -e sfeos_tools[elasticsearch]

For OpenSearch

pip install sfeos-tools[opensearch]

Or for local development:

pip install -e sfeos_tools[opensearch]

For Development (both backends)

pip install sfeos-tools[dev]

Or for local development:

pip install -e sfeos_tools[dev]

Usage

After installation, the sfeos-tools command will be available:

# View available commands
sfeos-tools --help

# View version
sfeos-tools --version

Commands

add-bbox-shape

Adds a bbox_shape field to existing collections for spatial search support. This migration is required for collections created before spatial search was added. Collections created or updated after this feature will automatically have the bbox_shape field.

sfeos-tools add-bbox-shape --backend [elasticsearch|opensearch] [options]

Options:

  • --backend: Database backend to use (required, choices: elasticsearch, opensearch)
  • --host: Database host (default: localhost or ES_HOST env var)
  • --port: Database port (default: 9200 for ES, 9202 for OS, or ES_PORT env var)
  • --use-ssl/--no-ssl: Use SSL connection (default: true or ES_USE_SSL env var)
  • --user: Database username (default: ES_USER env var)
  • --password: Database password (default: ES_PASS env var)

reindex

Reindexes all STAC indexes to the next version and updates aliases. This command performs the following actions:

  • Creates/updates index templates
  • Reindexes collections and item indexes to a new version
  • Applies asset migration script for compatibility
  • Switches aliases to the new indexes
sfeos-tools reindex --backend [elasticsearch|opensearch] [options]

Options:

  • --backend: Database backend to use (required, choices: elasticsearch, opensearch)
  • --host: Database host (default: localhost or ES_HOST env var)
  • --port: Database port (default: 9200 for ES, 9202 for OS, or ES_PORT env var)
  • --use-ssl/--no-ssl: Use SSL connection (default: true or ES_USE_SSL env var)
  • --user: Database username (default: ES_USER env var)
  • --password: Database password (default: ES_PASS env var)
  • --yes: Skip confirmation prompt

Example:

# Reindex Elasticsearch with custom host and no SSL
sfeos-tools reindex --backend elasticsearch --host localhost --port 9200 --no-ssl

# Reindex OpenSearch with default settings
sfeos-tools reindex --backend opensearch

Get help for a specific command

sfeos-tools add-bbox-shape --help


## Commands

### add-bbox-shape

Add `bbox_shape` field to existing collections for spatial search support.

**Basic usage:**

```bash
# Elasticsearch
sfeos-tools add-bbox-shape --backend elasticsearch

# OpenSearch
sfeos-tools add-bbox-shape --backend opensearch

Connection options:

# Local Docker Compose (no SSL)
sfeos-tools add-bbox-shape --backend elasticsearch --no-ssl

# Remote server with SSL
sfeos-tools add-bbox-shape \
  --backend elasticsearch \
  --host db.example.com \
  --port 9200 \
  --user admin \
  --password secret

# Using environment variables
ES_HOST=my-cluster.cloud.com ES_PORT=9243 ES_USER=elastic ES_PASS=changeme \
  sfeos-tools add-bbox-shape --backend elasticsearch

Available options:

  • --backend: Database backend (elasticsearch or opensearch) - required
  • --host: Database host (default: localhost or ES_HOST env var)
  • --port: Database port (default: 9200 or ES_PORT env var)
  • --use-ssl / --no-ssl: Use SSL connection (default: true or ES_USE_SSL env var)
  • --user: Database username (default: ES_USER env var)
  • --password: Database password (default: ES_PASS env var)

Development

To develop sfeos-tools locally:

# Install in editable mode with dev dependencies
pip install -e ./sfeos_tools[dev]

# Run the CLI
sfeos-tools --help

# Run tests
pytest

# Format code
pre-commit install
pre-commit run --all-files

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sfeos_tools-0.1.1.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

sfeos_tools-0.1.1-py3-none-any.whl (10.0 kB view details)

Uploaded Python 3

File details

Details for the file sfeos_tools-0.1.1.tar.gz.

File metadata

  • Download URL: sfeos_tools-0.1.1.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for sfeos_tools-0.1.1.tar.gz
Algorithm Hash digest
SHA256 57d2027cde9b971d2c6c8b3878a420559e4fad1f9197ff2bad1ad81fa516ace4
MD5 ef408918028964def74fb7d121f319e8
BLAKE2b-256 36a1b5701eddd4cd669a1a41fd5ad90633d2ab3ff16ecfa38ad093c34e55846f

See more details on using hashes here.

File details

Details for the file sfeos_tools-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: sfeos_tools-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for sfeos_tools-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 06e03951e265c2843ab34af33201c4cbf6179b2067d38559623c0cf39c50eed8
MD5 11e8f87f6880a088879a5cffeb698015
BLAKE2b-256 ec7eee56f66bd7abf3ca3523923842ec5dd49511420977c41f8909d9077128de

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page