Skip to main content

An implementation of STAC API based on the FastAPI framework using a static catalog as backend.

Project description

stac-fastapi-static

FastAPI

Static STAC Catalog backend for stac-fastapi, the FastAPI implementation of the STAC API spec.

This project is still in (late) initial development phase.

Overview

stac-fastapi-static is a stac-fastapi backend built in FastAPI. It provides an implementation of the STAC API spec ready to be deployed on top of a static STAC catalog. The target backend static catalog can be remotely hosted (by any static HTTP server) or locally hosted (filesystem).

STAC API Support

Extension Support
Core Yes
Item Search Yes

STAC API Extensions Support

From STAC API Extensions page :

Extension Support
Query No - Not intended : "It is recommended to implement the Filter Extension instead of the Query Extension" Query Extension homepage
Sort No - Not intended : Hard to implement in an performant enough manner to be viable with a static catalog
Transaction and Collection Transaction No - Not intended - Feasible
Fields No - Not intended - Feasible
Filter Yes
Collection Search Yes
Language No - Maybe soon ? - Feasible

Use Cases & Limitations

The appeal of instanciating a STAC API directly on top of a static catalog is obvious. However the performance issue will make or break this project.

Our goal is to provide viable performances on a 500,000 item static catalog.

Design Choices, Performances and limitations

Inherently, building an API on a 100,000s items static STAC catalog is going to be far slower than on a database backed catalog, however the STAC specs defines constraints (and recommendations) that can be abused to design a performant enough API.

todo : Include data plots from locust tests on big catalogs.

Usage

Prefered Method : Containerized API Server

docker run \
	--env-file .env \
	--env app_port=8000 \
	--env environment=prod \
	--env log_level=warning \
	--env catalog_href=<catalog_url> \
	--volume /tmp:/tmp \
	--publish 8000:8000 \
	ghcr.io/fntb/stac-fastapi-static: latest

Note :

  • --volume <path-to-catalog-directory>:/app/catalog/ and --env catalog_href=file:///app/catalog/catalog.json to serve a local catalog
  • See the Justfile.

Alternative Method : Python Packaged API Server

Install, create a dotenv configuration file (or pass configuration options as env variables), and run :

pip install stac-fastapi-static

# either
touch .env
stac-fastapi-static

# or
<option>=<value> stac-fastapi-static

Configuration Options

See the Settings model.

Amongst other :

class Settings(ApiSettings):
    # https://docs.pydantic.dev/latest/concepts/pydantic_settings/

    ...

    app_host: str = "0.0.0.0"
    app_port: int = 8000
    root_path: str = ""

    ...

Test and Develop

just --list

Or see the Justfile.

Release checklist : bump version, build, commit, tag, push, publish to pypi and ghcr.

History

stac-fastapi-static is being actively developped at the OPGC an observatory for the sciences of the universe (OSU) belonging to the CNRS and the UCA by its main author Pierre Fontbonne @fntb. It was originally reverse engineered from the stac-fastapi-pgstac backend by developmentseed.

License

OPEN LICENCE 2.0

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

stac_fastapi_static-0.0.2.tar.gz (30.1 kB view details)

Uploaded Source

Built Distribution

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

stac_fastapi_static-0.0.2-py3-none-any.whl (40.0 kB view details)

Uploaded Python 3

File details

Details for the file stac_fastapi_static-0.0.2.tar.gz.

File metadata

  • Download URL: stac_fastapi_static-0.0.2.tar.gz
  • Upload date:
  • Size: 30.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.6

File hashes

Hashes for stac_fastapi_static-0.0.2.tar.gz
Algorithm Hash digest
SHA256 29887669c24e3881cdeb64a37287b5230e15a2b0461606eb9d82b80644f7a29f
MD5 519c499c162b1e40a9ddb2b5b28e10ed
BLAKE2b-256 730587883f2e8e4f671d58e6ff9fee2d83113b27d5f6f4d4f45c68fac93d0b1c

See more details on using hashes here.

File details

Details for the file stac_fastapi_static-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for stac_fastapi_static-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 64d7fe748efc2fe294fb0026650c593a28732eca8891b1101512dd1733b5c342
MD5 06dfd590b7600ee4744d1e8ec0abc498
BLAKE2b-256 59da24ca5b013a3ac927dd0de4c0a69d11fb7686288756cf1dc6814392591e69

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