Venv Match
Capture an environment. Compare it with another. Understand what changed.
Venv Match (venv-match) is a zero-dependency Python environment comparison and diagnostic library designed to help developers investigate why the same Python application behaves differently across machines, virtual environments, or CI executions.
Features
- Structured Snapshots: Captures Python runtime details, installed distributions (PEP 503 normalized), OS/platform info, runtime context, and allowlisted environment variables into portable, versioned JSON files.
- Deterministic Comparison: Identifies
added,removed,changed, andunknown(uncollected) fields without false removals. - Transparent Diagnostics: Prioritizes differences (
critical,high,medium,low) with neutral, actionable explanations. - Privacy by Default: Never collects arbitrary environment variables, hostnames, or usernames by default; excludes and redacts secret-like variable names (
TOKEN,SECRET,PASSWORD,API_KEY, etc.). - CI-Ready CLI & Python API: Supports human-readable terminal output, machine-readable JSON reports,
--ignorepaths,--min-severitythresholds, and stable exit codes.
Installation
pip install venv-match
Supported Python versions: 3.10, 3.11, 3.12.
Quickstart (CLI)
Capture a baseline snapshot:
venv-match capture --output baseline.json --env TZ --env LANG
Inspect a snapshot:
venv-match inspect baseline.json
Compare two snapshots:
venv-match compare baseline.json current.json
Use in CI with severity thresholds and ignored paths:
venv-match compare baseline.json current.json \
--format json \
--min-severity medium \
--ignore sections.runtime.working_directory
Quickstart (Python API)
from venv_match import capture, compare, load_snapshot
baseline = capture()
baseline.save("baseline.json", overwrite=True)
current = capture()
loaded = load_snapshot("baseline.json")
report = compare(loaded, current)
print(report.has_differences)
print(report.summary())
for diff in report.differences:
print(diff.path, diff.change_type, diff.severity)
Exit Codes
| Exit Code | Meaning |
|---|---|
0 |
Command succeeded and no configured failure condition was met. |
1 |
Comparison completed and met the configured --fail-on-diff or --min-severity policy. |
2 |
Invalid command-line arguments or usage. |
3 |
Snapshot could not be loaded or parsed. |
4 |
Required collection or filesystem operation failed (including overwrite protection). |
5 |
Unsupported schema version or incompatible snapshots. |
Limitations
- Venv Match is a diagnostic comparison tool, not an environment manager; it never installs packages or modifies virtual environments.
- Observed differences indicate areas worth investigating, not definitive proof of what caused an application failure.
- Installed distribution versions (
importlib.metadata) do not fingerprint editable installs or native C library dependencies.
License
MIT
Metadata
Release files for venv-match 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| venv_match-0.1.0.tar.gz | 19.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| venv_match-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 43.9 kB
Release files / venv_match-0.1.0.tar.gz
| Download URL | venv_match-0.1.0.tar.gz |
|---|---|
| Size | 19.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cba302f96857e0175a2502ffb8a9b232fdefd26458d1d6e298c319bcf992d064
|
|
BLAKE2b-256 checksum How to use checksums |
ffde7fe130046e4d1ad653b297c2e74e9d5e0f72b6eb6e4683f4d54c710df6c7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.5.1 CPython/3.14.4 Linux/7.0.0-38-generic
|
Release files / venv_match-0.1.0-py3-none-any.whl
| Download URL | venv_match-0.1.0-py3-none-any.whl |
|---|---|
| Size | 24.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2b0cbdb21a804f818e42e2248e45e867d7439f685c306025f8c824180f0f09d4
|
|
BLAKE2b-256 checksum How to use checksums |
0a1de13281e086cfefc80e94b7ed748e80348706cf938988a02a09f9fc1330c1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.5.1 CPython/3.14.4 Linux/7.0.0-38-generic
|