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.2

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

Built distribution (wheel)

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

Total release size: 26.4 kB

Release files / standard_fastapi-0.2.2.tar.gz

Download URL standard_fastapi-0.2.2.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
5d958b5b1c8bc089fb01e91610f3115eeec18deae544adb8c8368d40cf978ac0
BLAKE2b-256 checksum
How to use checksums
7827e49f0e539d2fd215dd826282085716c3aa8d1520fb6b7c154059c67a6391
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.2-py3-none-any.whl

Download URL standard_fastapi-0.2.2-py3-none-any.whl
Size 15.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5de762546a0a127eb90272c687ab1ef4cf16ab78f6276c15422776ebdf5555d0
BLAKE2b-256 checksum
How to use checksums
f39b7f1c5e6cbb18b14b20c9848d8c86d04010cd81f7d50c66d4e98177911372
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

This release

0.2.2 This release

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