Skip to main content

Request context, header utilities, and logging middleware for FastAPI

Project description

csrd-context

Request context, header utilities, and logging middleware for FastAPI.

Package: csrd.context · Import: from csrd.context import ...

What's included

  • Framework-agnostic context variable system (headers, path params, query params, API version)
  • RequestContextMiddleware — captures request headers into context (raw ASGI, streaming-safe)
  • HTTPLoggingMiddleware — structured HTTP request/response logging (raw ASGI, streaming-safe)
  • Platform context variables (user_info_context, hit_id_context, app_id_context)
  • get_headers(), get_hit_id(), get_app_id() — accessors for the current request context

Installation

This package is part of the fastapi-common monorepo. Install via git:

uv pip install "csrd-context @ git+ssh://git@github.com/csrd-api/fastapi-common.git#subdirectory=packages/context"

Dependencies

  • csrd-models (Tier 1 — no other csrd.* sibling dependencies)

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

csrd_context-0.2.0.tar.gz (8.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

csrd_context-0.2.0-py3-none-any.whl (8.3 kB view details)

Uploaded Python 3

File details

Details for the file csrd_context-0.2.0.tar.gz.

File metadata

  • Download URL: csrd_context-0.2.0.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for csrd_context-0.2.0.tar.gz
Algorithm Hash digest
SHA256 846e596645d41dcceca0fa3b4fa3602f4fde1a71b205f88ac17a2ebbb79d5897
MD5 861f90ce202ee232cfb527feaab6e8e9
BLAKE2b-256 899e6d4cab3c5e7cd3913e9a965659503b7860371f8c8aa5f973367d733be36e

See more details on using hashes here.

Provenance

The following attestation bundles were made for csrd_context-0.2.0.tar.gz:

Publisher: release.yml on csrd-api/fastapi-common

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file csrd_context-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: csrd_context-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for csrd_context-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2f1d3be853f949cb1e04c974c9dc312cb4e2c1c06b91404725d45fa273a3c7fc
MD5 3fbf4498f43b84c65c455a3d908b5f57
BLAKE2b-256 f72928d109df3d1f39b3a74667cfaf37603bcce992238164abdeffab6b1ea12c

See more details on using hashes here.

Provenance

The following attestation bundles were made for csrd_context-0.2.0-py3-none-any.whl:

Publisher: release.yml on csrd-api/fastapi-common

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page