Install & Compatibility
Where this runs
tested against v0.9.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.760s · 21.3MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.1s · import 0.644s · 22MB
19MB installed
● package 19MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Betamax
✓ from betamax import Betamax
✗ from betamax import BetamaxSession
BetamaxSession does not exist; the correct class is Betamax.
recorder
✓ with Betamax(session) as recorder:
✗ recorder = Betamax(session); recorder.start()
Do not manually start/stop; use as context manager.
Record and replay HTTP requests using Betamax with a requests.Session.
import requests
from betamax import Betamax
session = requests.Session()
recorder = Betamax(session)
with recorder.use_cassette('example'):
response = session.get('https://httpbin.org/get')
print(response.status_code)
Errors
Common errors & fixes
FileNotFoundError: [Errno 2] No such file or directory: 'cassettes/example.json'
Default cassette_library_dir is 'cassettes/' and it does not exist.
fixCreate a 'cassettes' folder in your working directory, or set cassette_library_dir to an existing path.
No cassette found for request: GET http://httpbin.org/get
The request being made does not match any recorded cassette; maybe headers or body differ.
fixEnsure that the request (method, URI, headers, body) exactly matches the recorded interaction. Or use 'record_mode' to allow recording.
Upgrade
Version history
0.9.0latest on PyPI · released Feb 8, 2024
Audit
Dependencies
No dependency data recorded yet.