Skip to main content

standard-fastapi

FastAPI integration for the standard Python library. All six distributions share one release version. Install it directly with python -m pip install standard-fastapi or use the standard[fastapi] extra.

Define the application's settings model in core/settings.py:

from std.config import YamlSettings


class Settings(YamlSettings):
    std_config_file = "settings.yaml"
    service_name: str

In main.py, create the app and inject that settings instance once:

from typing import Annotated

from fastapi import FastAPI
from app.core.settings import Settings
from std.fastapi import settings_dependency


def create_app() -> FastAPI:
    settings = Settings()  # Create once in the application composition root.
    app = FastAPI()
    app.state.settings = settings
    settings_dep = settings_dependency(Settings)

    @app.get("/health")
    async def health(settings: Annotated[Settings, settings_dep]) -> dict[str, str]:
        return {"service": settings.service_name}

    return app

Create Settings() once in main.py and assign the instance to app.state.settings. The dependency returns that injected instance and never constructs or reloads settings.

The integration includes APIConfig and FastAPISetup for app construction, LifecycleManager for injected background services, AppTokenAuth and TokenAuthMiddleware, health-check endpoints, request logging middleware, and the Pydantic Settings dependency helper. Core service lifecycle types remain available as std.service from standard.

The core and all five integration distributions share one release version, derived from the same vX.Y.Z tag. The std command and core modules remain in the standard distribution. See the API reference and the independent consumer sample for public signatures, behavior, and a complete application example.

Metadata

Release files for standard-fastapi 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for standard-fastapi 0.2.4
File Size Uploaded
standard_fastapi-0.2.4.tar.gz 10.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for standard-fastapi 0.2.4
File Interpreter ABI Platform
standard_fastapi-0.2.4-py3-none-any.whl Python 3 none any Details

Total release size: 26.5 kB

Release files / standard_fastapi-0.2.4.tar.gz

Download URL standard_fastapi-0.2.4.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
9c03e61a3da8c24d8daae602a0ea5c7db847d2094f7d6ec04780a875d109f2a0
BLAKE2b-256 checksum
How to use checksums
4e39938f30b2a861f4e069ea7988bf8ec59dc3b12d69c7883f0b0ccda1fe586a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release files / standard_fastapi-0.2.4-py3-none-any.whl

Download URL standard_fastapi-0.2.4-py3-none-any.whl
Size 15.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6e3d46e689c44959a29dd7902099eea947110c7196d205b4eebe1fe15c2fc392
BLAKE2b-256 checksum
How to use checksums
81d27f66500ce8d85f405c821fe8885e8cefcfd2dcb559e56c4b28f6ed7e2bb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 13, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.4 This release

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page