Documentation Overview
VEXFOX is an open-source Python developer tool engineered for deterministic HTTP interaction recording, secret sanitization, and strictly offline replay using HTTPX.
Core Architectural Principles
VEXFOX intercepts HTTP interactions directly at the HTTPX transport boundary (`VexfoxSyncTransport` and `VexfoxAsyncTransport`). It never monkey-patches Python's global `socket` module.
Sensitive credentials, session cookies, Bearer tokens, and API keys are sanitized in-memory before cassette files ever touch the filesystem.
Requests match on method, normalized URL, query keys, and structural JSON bodies. Formatting whitespace or arbitrary JSON key ordering differences never trigger false mismatches.
Recording contexts are isolated per thread and per asyncio task using standard Python `contextvars`, making concurrent test runners safe.
Guides & Reference
Getting Started
System requirements, installation, minimal sync/async recording examples, and pytest integration.
Configuration & Modes
Record modes (once, record, replay, none), semantic request matching rules, and VexfoxConfig options.
Security & Redaction
In-memory pre-persistence scrubbing for headers, query params, JSON bodies, and high-entropy API tokens.
Troubleshooting & Diagnostics
Understanding RequestMismatchError, missing cassette errors, and using the built-in CLI inspection toolkit.
Quick Verification Snippet
import httpx
import vexfox
# Wraps standard HTTPX client calls in a deterministic cassette
with vexfox.use_cassette("fixtures/users.json"):
response = httpx.get("https://api.example.com/v1/users")
assert response.status_code == 200