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

Uploaded Source

Built Distribution

safir-7.0.0-py3-none-any.whl (140.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for safir-7.0.0.tar.gz
Algorithm Hash digest
SHA256 a43143ec1a8b569a27b0731c96393b91df1f0a8a7e811efe9e59f303087dc679
MD5 8a0be2b84afd50b8a6a8d5bd79b4498b
BLAKE2b-256 5fb5b48b724f947a5c120b1f86ec87e79e0bb4256286d81e8e2c517d82ffeb89

See more details on using hashes here.

Provenance

The following attestation bundles were made for safir-7.0.0.tar.gz:

Publisher: ci.yaml on lsst-sqre/safir

Attestations:

File details

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

File metadata

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

File hashes

Hashes for safir-7.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b781c5d3a7db07d91be2dffcf5842406b0b40d75a130c167b1527147c754dddc
MD5 1bc0dc877c287b646a7cc926c71696af
BLAKE2b-256 a6efb1d19449971f4af8cabd65ffc0cbf8e4da26774b47c93bba350764e62e2b

See more details on using hashes here.

Provenance

The following attestation bundles were made for safir-7.0.0-py3-none-any.whl:

Publisher: ci.yaml on lsst-sqre/safir

Attestations:

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