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
Built Distribution
File details
Details for the file safir-3.5.0.tar.gz
.
File metadata
- Download URL: safir-3.5.0.tar.gz
- Upload date:
- Size: 75.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7e078d174379eaaf47ff8cb7d39e5d939dfd0afdf4389f5961a82da949921c0e |
|
MD5 | 164a99a611a859751888bf6de216fcf7 |
|
BLAKE2b-256 | b5686e8d7dcf07671cfb543ca703e3b706b2665a543a29530a7d708703015e46 |
File details
Details for the file safir-3.5.0-py3-none-any.whl
.
File metadata
- Download URL: safir-3.5.0-py3-none-any.whl
- Upload date:
- Size: 36.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3a43ac1466b139142a84c5e931ca0a1780e5727430d4105911cecc14b68accf |
|
MD5 | 964c723853b8d66d7c535e90477e802c |
|
BLAKE2b-256 | 1de87027f20e9df73418d5e5815842748cb4f66c38bf7009a59068bd82070353 |