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

Uploaded Source

Built Distribution

safir-6.4.0-py3-none-any.whl (120.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: safir-6.4.0.tar.gz
  • Upload date:
  • Size: 141.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for safir-6.4.0.tar.gz
Algorithm Hash digest
SHA256 ba7af071eab0d198e6e15a2117028566f3f4237e02e2278e8bfc2633a7c68228
MD5 ef278e8bf6ae85c9f236a35e4afd98c8
BLAKE2b-256 ef30c94e62d7f5b7e3d723d0182bf9a1881c1654ad1e5594ba933c366263b3c6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: safir-6.4.0-py3-none-any.whl
  • Upload date:
  • Size: 120.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.6

File hashes

Hashes for safir-6.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f38c3f1d7d76d304984b572288826510e5c7a0e1f965b2eabdd7f3bace07c48a
MD5 caf355204087498d22084082422c65b6
BLAKE2b-256 dc62bd3d335a5ee018d8070e1d3ec8d68b0b5d07718ac6f4e1584bc54191b4d1

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