Skip to main content

fastapi-whowhywhen

WhoWhyWhen middleware for FastAPI. Create a WhoWhyWhen account at https://whowhywhen.com/ and get your API key.

Installation

pip install fastapi-whowhywhen

Usage

from fastapi import FastAPI
from fastapi_whowhywhen import WhoWhyWhenMiddleware
from starlette.background import BackgroundTasks

app = FastAPI()

app.add_middleware(
    WhoWhyWhenMiddleware,
    api_key="YOUR_API_KEY"
)

@app.get("/")
async def root():
    return {"message": "Hello, World!"}

# Add the following middleware to your FastAPI app
@app.middleware("http")
async def add_background_tasks(request: Request, call_next):
    request.state.background_tasks = BackgroundTasks()
    response = await call_next(request)
    response.background = request.state.background_tasks
    return response

Metadata

Release files for fastapi-whowhywhen 0.1.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 fastapi-whowhywhen 0.1.1
File Size Uploaded
fastapi_whowhywhen-0.1.1.tar.gz 3.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fastapi-whowhywhen 0.1.1
File Interpreter ABI Platform
fastapi_whowhywhen-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 6.6 kB

Release files / fastapi_whowhywhen-0.1.1.tar.gz

Download URL fastapi_whowhywhen-0.1.1.tar.gz
Size 3.0 kB
Tags Source
SHA-256 checksum
How to use checksums
6ec534761ffc1a94d828630bf4c34e5fe6e5201ebfe3184a2c29616b28a2692f
BLAKE2b-256 checksum
How to use checksums
9526cf06bfbc4af9806b5246cd3449b499337b3daeb91637920d86b26eb09562
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.4

Release files / fastapi_whowhywhen-0.1.1-py3-none-any.whl

Download URL fastapi_whowhywhen-0.1.1-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb243e941b7d9fd995564a433a3b10504de1f8c295fa0cd17f45129d688c5018
BLAKE2b-256 checksum
How to use checksums
8e849639f9bb91beb5c869c154d79ecded8eff460c72c7f03531cdc8f2485c3f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.4

Release history Release notifications | RSS feed

This release

0.1.1 This release

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