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


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

safir-5.0.0a3.tar.gz (161.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

safir-5.0.0a3-py3-none-any.whl (73.7 kB view details)

Uploaded Python 3

File details

Details for the file safir-5.0.0a3.tar.gz.

File metadata

  • Download URL: safir-5.0.0a3.tar.gz
  • Upload date:
  • Size: 161.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for safir-5.0.0a3.tar.gz
Algorithm Hash digest
SHA256 3ca9c4d19836218876ce8a1f00806b825cdfd0254deca0ceeabacf09a1d592cf
MD5 e743a006a22567c0531ac5c0c342c947
BLAKE2b-256 7b0b8e49a105b5cc160468751c9ceae7ce46436cf99f6f2ad953035d8918ab3a

See more details on using hashes here.

File details

Details for the file safir-5.0.0a3-py3-none-any.whl.

File metadata

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

File hashes

Hashes for safir-5.0.0a3-py3-none-any.whl
Algorithm Hash digest
SHA256 5595c45dff9b5edcf3c69dbfb2176cccc34e1f5499d00ef546523488e0b95dad
MD5 92e4aec4e4ed339d51424c0af87679d5
BLAKE2b-256 abe94fe49a3df2a076d0930b9a30bb3c710473aa204b28478ac2512604ffc03c

See more details on using hashes here.

Supported by

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