VEXFOX DOCUMENTATION

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

1. Transport Layer Isolation

VEXFOX intercepts HTTP interactions directly at the HTTPX transport boundary (`VexfoxSyncTransport` and `VexfoxAsyncTransport`). It never monkey-patches Python's global `socket` module.

2. Pre-Persistence Redaction

Sensitive credentials, session cookies, Bearer tokens, and API keys are sanitized in-memory before cassette files ever touch the filesystem.

3. Semantic Request Matching

Requests match on method, normalized URL, query keys, and structural JSON bodies. Formatting whitespace or arbitrary JSON key ordering differences never trigger false mismatches.

4. Concurrency Safety

Recording contexts are isolated per thread and per asyncio task using standard Python `contextvars`, making concurrent test runners safe.

Guides & Reference

Quick Verification Snippet

quickstart.py
7 lines
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