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

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

Uploaded Source

Built Distribution

safir-10.1.0-py3-none-any.whl (153.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: safir-10.1.0.tar.gz
  • Upload date:
  • Size: 181.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.16

File hashes

Hashes for safir-10.1.0.tar.gz
Algorithm Hash digest
SHA256 84d9a05eb907d7c46bcfb7048596720a865bf10e68af7353e4ef8913ff72040a
MD5 d5f3d8aab21a244e8627c707cd1d7660
BLAKE2b-256 9d6819055d3e1c849cba5680bd3bf05cfac4f983e8ea981139f4a9ac5b15da86

See more details on using hashes here.

File details

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

File metadata

  • Download URL: safir-10.1.0-py3-none-any.whl
  • Upload date:
  • Size: 153.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.6.16

File hashes

Hashes for safir-10.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4d41d9460df0dd4e1aa6c15b27579bdd941d550282129effed94e39ba7bdf24a
MD5 85b7e8f6792a1659790d396e17a2bb42
BLAKE2b-256 950f556b647971ceb1408670157a8fe155a598857692868d74d19466e0353138

See more details on using hashes here.

Supported by

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