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-6.2.0.tar.gz (135.1 kB view details)

Uploaded Source

Built Distribution

safir-6.2.0-py3-none-any.whl (117.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: safir-6.2.0.tar.gz
  • Upload date:
  • Size: 135.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for safir-6.2.0.tar.gz
Algorithm Hash digest
SHA256 335219abba8ed663395bcf6cf86a60ec8de8412ea212dc0dbe8425e9faa7bc97
MD5 a61296333d1db2e2deab37dd28289a27
BLAKE2b-256 aefb4130668b45cb14a38bb87274116fb20b4a4cd72eb05f0f36f0f0930c7a33

See more details on using hashes here.

File details

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

File metadata

  • Download URL: safir-6.2.0-py3-none-any.whl
  • Upload date:
  • Size: 117.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.4

File hashes

Hashes for safir-6.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 61cf6fd3839c0945bcc7c01469dc8fcd19351eba33b6022c596684d87763e50e
MD5 4bfd7c5051c3198b4734573630975f04
BLAKE2b-256 4c048a0c8a953aaca0d6b5c82a3cedf96e1c45d3d48751884c6faf73c63507b9

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