Skip to main content

FluxFast for FastAPI

The Python package provides FastAPI page routes, scoped versioned resources, a bounded in-memory cache, concurrent loader resolution, mutation helpers, 422 mapping, redirects, and the fluxfast/1 protocol.

python -m pip install fluxfast
from fastapi import FastAPI
from fluxfast import FluxFast, Page, resource, scope

app = FastAPI()
flux = FluxFast(app)

@flux.page("/")
async def home():
    return Page(
        "home/index",
        resources=[
            resource("news", load_news, scope=scope.public(), ttl=60),
        ],
    )

Reusable data must declare an appropriate public, user, tenant, or custom scope. See the repository protocol and caching documentation for wire and invalidation semantics.

For a Next.js consumer, install its backend and run both development processes under one supervisor:

python -m pip install -e backend
fluxfast dev backend.app.main:app

The CLI starts FastAPI on an available internal loopback port and Next on the browser-facing development port. The companion Next config uses the injected server-only address, so browser requests stay same-origin.

Application & Resource Contracts

Declare server-owned contracts with Pydantic for typed resources and general application types:

from pydantic import BaseModel
from fluxfast import FluxFast

app = FastAPI()
flux = FluxFast(app)

class Room(BaseModel):
    id: int
    number: str

class CreateRoomInput(BaseModel):
    number: str
    floor: int

ROOMS = flux.define_resource("rooms", list[Room])
CREATE_ROOM = flux.define_type(
    "CreateRoomInput",
    CreateRoomInput,
    mode="validation",
)

Export deterministic fluxfast-schema/2 developer manifests and generate frontend contracts with one command:

fluxfast types backend.app.main:app --frontend frontend

Use --check in CI to detect contract drift without writing files. See the contract documentation and type safety guide.

Metadata

Release files for fluxfast 1.0.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 fluxfast 1.0.1
File Size Uploaded
fluxfast-1.0.1.tar.gz 171.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fluxfast 1.0.1
File Interpreter ABI Platform
fluxfast-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 256.9 kB

Release files / fluxfast-1.0.1.tar.gz

Download URL fluxfast-1.0.1.tar.gz
Size 171.9 kB
Tags Source
SHA-256 checksum
How to use checksums
a9f4706f9265d340c5e1995b756cbc36d423406a4a4c7099591a518136c55a07
BLAKE2b-256 checksum
How to use checksums
2a2d9fe3d98b83b1d4a9435a3cfd69aa4621a403ab3b3d801f09830c49e74586
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 Sep 28, 2026.

Transparency log

Release files / fluxfast-1.0.1-py3-none-any.whl

Download URL fluxfast-1.0.1-py3-none-any.whl
Size 85.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
25c5099a5e51913a66551889dcc0296f978f838f10664393229c7285548b3c44
BLAKE2b-256 checksum
How to use checksums
a2380951d14572808975ad455c4ac863093fd185212fd7ac7301091d9d338409
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 Sep 28, 2026.

Transparency log

Release history Release notifications | RSS feed

1.2.0

2 release files

1.1.0

2 release files

This release

1.0.1 This release

2 release files

1.0.0

2 release files

0.9.0

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.0

2 release files

0.6.0

2 release files

0.5.0

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

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