{"id":23928,"library":"keboola-vcr","title":"Keboola VCR","description":"A library for recording, sanitizing, and validating HTTP and database interactions for Keboola component tests using VCR-based cassettes. Version 0.5.0 adds DB VCR support for recording/replaying database interactions. Regular releases, active development.","status":"active","version":"0.5.0","language":"python","source_language":"en","source_url":"https://github.com/keboola/python-vcr-tests","tags":["vcr","testing","keboola","http","database","cassette"],"install":[{"cmd":"pip install keboola-vcr","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Core VCR recording engine","package":"vcrpy","optional":false},{"reason":"Cassette YAML serialization","package":"pyyaml","optional":false},{"reason":"Database VCR support (optional for DB recording)","package":"sqlalchemy","optional":true}],"imports":[{"note":"Common mis-import due to similar name with vcrpy.VCR","wrong":"from keboola_vcr import VCR","symbol":"KeboolaVcr","correct":"from keboola_vcr import KeboolaVcr"},{"note":"DbVcr is in the db submodule, not top-level","wrong":"from keboola_vcr import DbVcr","symbol":"DbVcr","correct":"from keboola_vcr.db import DbVcr"},{"note":"Cassette class is in the cassette submodule","wrong":"from keboola_vcr import KeboolaVcrCassette","symbol":"KeboolaVcrCassette","correct":"from keboola_vcr.cassette import KeboolaVcrCassette"}],"quickstart":{"code":"from keboola_vcr import KeboolaVcr\n\nvcr = KeboolaVcr(\n    cassette_library_dir='cassettes',\n    record_mode='once',\n    sanitizers=['KBC::ComponentConfig::%s::#token']\n)\n\nwith vcr.use_cassette('test_get_users.yaml') as cassette:\n    # Your HTTP calls go here, they will be recorded/replayed\n    pass\n","lang":"python","description":"Basic usage: create a KeboolaVcr instance with sanitizers and use a cassette for recording/replaying HTTP interactions."},"warnings":[{"fix":"Regenerate cassettes by deleting them and re-running tests with record_mode='all'.","message":"Version 0.2.0 introduced memory usage improvements and sanitizer dedup; older cassettes may need regeneration.","severity":"breaking","affected_versions":"<0.2.0"},{"fix":"Use `from keboola_vcr import KeboolaVcr`.","message":"The old import path `from keboola_vcr import VCR` is deprecated in favor of `KeboolaVcr` since v0.1.0.","severity":"deprecated","affected_versions":">=0.1.0"},{"fix":"Manually create an SQLAlchemy engine and pass it to DbVcr.","message":"DbVcr requires SQLAlchemy and a database engine; it does not auto-detect database type.","severity":"gotcha","affected_versions":">=0.5.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install keboola-vcr` to install.","cause":"Library not installed or installed incorrectly.","error":"ModuleNotFoundError: No module named 'keboola_vcr'"},{"fix":"Use `from keboola_vcr import KeboolaVcr`.","cause":"The old import path is removed in newer versions.","error":"ImportError: cannot import name 'VCR' from 'keboola_vcr'"},{"fix":"Pass `cassette_library_dir='path/to/cassettes'` when creating KeboolaVcr instance.","cause":"KeboolaVcr requires cassette_library_dir.","error":"TypeError: __init__() missing 1 required positional argument: 'cassette_library_dir'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}