--- id: keboola-vcr version: "0.7.1" license: MIT license_treatment: permissive maintenance: active --- # keboola.vcr — VCR recording, sanitization, and validation for Keboola component HTTP interactions License: permissive · Maintenance: active · Downloads: 129.1K/mo ## What it is and what it does keboola.vcr is a testing utility that records real HTTP interactions made by Keboola data components, stores them as replayable JSON cassettes, and sanitizes sensitive data before saving. It wraps vcrpy and freezegun to capture and replay API responses deterministically, letting you test components against recorded interactions without hitting live APIs repeatedly. The package's main value is its sanitization layer: it can redact secrets and tokens from cassettes before storage (cassette-only mode), or redact sensitive fields from responses before the component even reads them (scrub_before_read mode), preventing real customer data from leaking into test outputs. It also validates component output against snapshots to catch regressions. Use it for: - Record live API responses during component development, then replay them in CI/CD without external API calls or rate limits. - Redact API keys, tokens, and customer PII from cassettes before committing them to version control. - Prevent real sensitive data from reaching component output by scrubbing response fields before the component processes them. - Generate test directory scaffolding from component configuration definitions to standardize test setup. - Compare component output snapshots across runs to detect unintended behavior changes or regressions. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Records, sanitizes, and validates HTTP interactions for Keboola component testing by capturing real API responses as JSON cassettes and redacting secrets before storage or component consumption. Yes, if you are testing Keboola components that make HTTP calls. The package solves a real problem—capturing and replaying API interactions safely—with low install friction and active maintenance. Its scrub_before_read feature is particularly valuable for preventing real customer data from leaking into test outputs. Not relevant for non-HTTP or non-Keboola testing scenarios. ## Install pip install keboola-vcr uv add keboola-vcr poetry add keboola-vcr ## Installing keboola.vcr Before you install: Low friction: pure Python wheel with only three runtime dependencies (vcrpy, freezegun, typing-extensions). Active maintenance with a release 11 days ago and no known vulnerabilities. License in practice: MIT license permits unrestricted use, modification, and distribution with minimal restrictions—suitable for both open and proprietary projects. Quickstart: pip install keboola.vcr from keboola.vcr.recorder import VCRRecorder from keboola.vcr.sanitizers import DefaultSanitizer recorder = VCRRecorder( cassette_dir="tests/cassettes/my_test", secrets={"api_key": "secret"}, ) Requires Python 3.10 or later. Verify before relying: - Whether scrub_before_read mode works reliably across all output formats (CSV, Parquet, direct-to-Storage) mentioned in the description. - Performance characteristics when recording large HTTP interactions or many sequential requests. - Compatibility with async/concurrent HTTP libraries beyond what vcrpy natively supports. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 129.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags vcr http recording testing, api response cassette sanitization, http mock recording secrets, test fixture http capture, keboola component testing, api interaction replay, sensitive data redaction testing, http-mocking, test-fixtures, data-sanitization [View on SkillFed](https://skillfed.io/packages/keboola-vcr) · [View on PyPI](https://pypi.org/project/keboola-vcr/)