Skip to main content

standard-fastapi

FastAPI integration for the standard Python library. After publication, 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 fastapi import Depends, 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: Settings = Depends(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 library and this package are versioned independently. The std command and core modules remain in the standard distribution. See the API reference for public signatures, behavior, and examples.

Metadata

Release files for standard-fastapi 0.2.1

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.1
File Size Uploaded
standard_fastapi-0.2.1.tar.gz 10.6 kB Details

Built distribution (wheel)

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

Total release size: 26.4 kB

Release files / standard_fastapi-0.2.1.tar.gz

Download URL standard_fastapi-0.2.1.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7c653e509f2ea43606203d9bb7db2d5517be63a08f894b3cd340e77fff21bdd0
BLAKE2b-256 checksum
How to use checksums
ff3c146a2417175f88ab8c897df08f711f44207d80fa0a66f9e7968f6f5ea9a2
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.1-py3-none-any.whl

Download URL standard_fastapi-0.2.1-py3-none-any.whl
Size 15.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
02922b1b347552870c4571601d982887c944ba00a0b7b0c28fbaf11a53735849
BLAKE2b-256 checksum
How to use checksums
35f524057bfa8b7eb741ad99ba943d35dd0fab782bdbf786d8c029cc58b00791
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

0.2.4

2 release files

0.2.3

2 release files

0.2.2

2 release files

This release

0.2.1 This release

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