Skip to main content

The Rubin Observatory SQuaRE framework for FastAPI services.

Project description

Safir

Safir is Rubin Observatory's library for building FastAPI services for the Rubin Science Platform (Phalanx) and Roundtable Kubernetes clusters. Safir is developed, maintained, and field tested by the SQuaRE team.

Safir is available from PyPI:

pip install safir

The best way to create a new FastAPI/Safir service is with the fastapi_safir_app template.

Read more about Safir at https://safir.lsst.io.

Features

  • Set up an httpx.AsyncClient as part of the application start-up and shutdown lifecycle.
  • Set up structlog-based logging.
  • Middleware for attaching request context to the logger to include a request UUID, method, and route in all log messages.
  • Process X-Forwarded-* headers to determine the source IP and related information of the request.
  • Gather and structure standard metadata about your application.
  • Operate a distributed Redis job queue with arq using convenient clients, testing mocks, and a FastAPI dependency.

Developing Safir

The best way to start contributing to Safir is by cloning this repository creating a virtual environment, and running the init command:

git clone https://github.com/lsst-sqre/safir.git
cd safir
make init

For details, see https://safir.lsst.io/dev/development.html.

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

safir-4.5.0.tar.gz (159.0 kB view details)

Uploaded Source

Built Distribution

safir-4.5.0-py3-none-any.whl (73.2 kB view details)

Uploaded Python 3

File details

Details for the file safir-4.5.0.tar.gz.

File metadata

  • Download URL: safir-4.5.0.tar.gz
  • Upload date:
  • Size: 159.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for safir-4.5.0.tar.gz
Algorithm Hash digest
SHA256 19268a22f9e530a98a780e416e4a8c79b40e275853fdae031d15f8f99fe7ebf4
MD5 8c1d8803593bafb88f40fad658e75c7f
BLAKE2b-256 8487d6002a111158320f9eb9ea509987701da8089d7e8037560b4876cfadcf14

See more details on using hashes here.

File details

Details for the file safir-4.5.0-py3-none-any.whl.

File metadata

  • Download URL: safir-4.5.0-py3-none-any.whl
  • Upload date:
  • Size: 73.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.5

File hashes

Hashes for safir-4.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 36301d094f4da08f1f54a3c7379db6603fa04e383df27a84a54c8a0a7a6cdf6e
MD5 ae0e0a0074d71e8ac71de4ce6493c1d8
BLAKE2b-256 0240e2c453ef1568c6830a2f21566e71c00bb013dd6bec6b688801cb40ea6804

See more details on using hashes here.

Supported by

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