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

Uploaded Source

Built Distribution

safir-3.8.0-py3-none-any.whl (47.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: safir-3.8.0.tar.gz
  • Upload date:
  • Size: 101.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for safir-3.8.0.tar.gz
Algorithm Hash digest
SHA256 25bd4f069d2ae76db0ccf3dcd5e2361a424cc66f138c5c59504abf1908e66161
MD5 a9536b1378ef1e2925b9cb72adb4ab87
BLAKE2b-256 0e9c99f9a9449000539c8d83bbcdbcc14666ac9ed8f9a6fc7f44544f9db93cac

See more details on using hashes here.

File details

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

File metadata

  • Download URL: safir-3.8.0-py3-none-any.whl
  • Upload date:
  • Size: 47.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.2

File hashes

Hashes for safir-3.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3bb373ced893155821124cebecb7abaafb15deb24cd717bb9ef00f8b399af228
MD5 03c14c186e96b2bef3fc9cbad71135a5
BLAKE2b-256 d133871ae03273e44d3a3e08fb138e75f65f745fdbf9fcf1e8af7a792e0e4ff8

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