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.3.tar.gz (30.5 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.3-py3-none-any.whl (40.4 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for stac_fastapi_static-0.0.3.tar.gz
Algorithm Hash digest
SHA256 b13b77091ab2b7c27c7c0a531cd4758917bc64b6a420c9e6e0c632e93d758892
MD5 46490614a51dde10059139fe984a60ef
BLAKE2b-256 7b581898e3b521904626de9a2be1bcef8c64e6c6f33e1205bd76669a405cf8af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stac_fastapi_static-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 421e9235c86f2c3d693554d3006aa4de5ffddf0f3545d4e32f041dc1f25fc641
MD5 ff6dd16a0e1fe5132e5c5098b5f99f95
BLAKE2b-256 a3393bf4ee0c642bde0fc8e8aa3acf166459c9d3cfe3d188ac75b7140b4688f2

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