Skip to main content

wxyc-fastapi

Shared FastAPI service template for WXYC's Python services. Consolidates the duplicated service scaffolding currently forked across library-metadata-lookup (LML), request-o-matic (rom), and semantic-index into a single package, eliminates measurable drift between the three forks, and gives the next FastAPI service a template to inherit instead of fork.

Status: shipping — published to PyPI as wxyc-fastapi (1.x; phases A–E landed, see CHANGELOG.md), consumed by library-metadata-lookup, request-o-matic, and semantic-index. The original implementation plan is at WXYC/wiki/plans/wxyc-fastapi; it traces back to P1 of the 2026-05-10 cross-repo contract audit (WXYC/wiki#51).

Package surface

wxyc_fastapi/
├── observability/
│   ├── sentry.py        # init_sentry(), add_breadcrumb(), capture_exception()
│   ├── telemetry.py     # RequestTelemetry, StepResult, track_step, as_server_timing
│   ├── cache_stats.py   # ContextVar, init_cache_stats, record_*, get_cache_stats
│   └── posthog.py       # get_posthog_client(event_prefix) — capture rate limiter, flush, shutdown
├── testing.py           # CountingPosthog + capture_budget: pin per-operation capture counts in tests
├── http/
│   └── singleton.py     # async_singleton(factory) - getter+closer pair w/ asyncio.Lock
├── healthcheck/
│   ├── liveness.py      # 200 OK with {"status":"healthy"} body, no probes
│   └── readiness.py     # readiness_router(checks: list[Check]) -> APIRouter
└── db/
    └── lazy_pg.py       # LazyPgConnection

Cross-language consolidation (codegen and healthcheck response shape) lives in wxyc-shared instead. See the plan's §2.4 for what lives where and why.

Phasing

Phase Module Version
A observability/* (sentry, telemetry, cache_stats, posthog) v0.1.0
B healthcheck/* (Python implementation) v0.2.0
C Healthcheck response schemas in wxyc-shared/api.yaml (parallel with B) (no wxyc-fastapi version bump)
D http/singleton v0.3.0
E db/lazy_pg v1.0.0

Contributing

Implementation and migration tasks are filed as sub-issues of the rollout epic in this repo. See the issues tab and the project board for what's open.

Metadata

Release files for wxyc-fastapi 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wxyc-fastapi 1.4.0
File Size Uploaded Provenance
wxyc_fastapi-1.4.0.tar.gz 26.7 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for wxyc-fastapi 1.4.0
File Interpreter ABI Platform
wxyc_fastapi-1.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 56.1 kB

Release files / wxyc_fastapi-1.4.0.tar.gz

Download URL wxyc_fastapi-1.4.0.tar.gz
Size 26.7 kB
Tags Source
SHA-256 checksum
How to use checksums
2d0b03f0ce7a1be51e6379e8c56ff25378d16e6d7c19f7c8beb2f52c93adff39
BLAKE2b-256 checksum
How to use checksums
95bd4da7356a8c5108d8eea9a95fc0b7732c3bf072f84ba8cbdc5d752d007ea9
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 Aug 9, 2026.

Transparency log

Release files / wxyc_fastapi-1.4.0-py3-none-any.whl

Download URL wxyc_fastapi-1.4.0-py3-none-any.whl
Size 29.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5b7d52f108706444d0641272167ca8c298bf1d2c7056a3e3c34cc039c607e61f
BLAKE2b-256 checksum
How to use checksums
a2a5328ac08ca3fa3defa3127e1c668e203c67df87635f8bac68d73713ff28dd
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 Aug 9, 2026.

Transparency log

Security for wxyc-fastapi 1.4.0

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for wxyc_fastapi-1.4.0.tar.gz

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 Aug 9, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

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