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.6.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.6.0
File Size Uploaded Provenance
wxyc_fastapi-1.6.0.tar.gz 34.1 kB With provenance Details

Built distribution (wheel)

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

Total release size: 73.0 kB

Release files / wxyc_fastapi-1.6.0.tar.gz

Download URL wxyc_fastapi-1.6.0.tar.gz
Size 34.1 kB
Tags Source
SHA-256 checksum
How to use checksums
132c9b7bbea25d0d5dd50baab74ef47ee911ea9edde7cba1773db9f6cfe95cb5
BLAKE2b-256 checksum
How to use checksums
c22cbc8987ce6bcaf3121d02fbe96b9cb65d3c1c8ac72419c19c2c0540584e05
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 20, 2026.

Transparency log

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

Download URL wxyc_fastapi-1.6.0-py3-none-any.whl
Size 38.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5015605e28265099b598248f3a8bd8311c0dda522898dbe0daba42810eec5e3c
BLAKE2b-256 checksum
How to use checksums
da1d252614a660ae2fa1f22b5370583982bfc6618009f65fab2e2860ba858dfd
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 20, 2026.

Transparency log

Security for wxyc-fastapi 1.6.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.6.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 Oct 20, 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