Compare configuration files across environments
Project description
philiprehberger-config-diff
Compare configuration files across environments.
Installation
pip install philiprehberger-config-diff
Usage
from philiprehberger_config_diff import diff_files, diff_dicts
# Compare files (JSON, TOML, INI, .env)
report = diff_files("config.dev.json", "config.prod.json")
for change in report.changes:
print(change) # "+ db.name = 'proddb'" / "~ port: 3000 -> 8080"
print(report.summary())
# "Added: 3, Removed: 1, Modified: 5"
# Filter by key patterns
report = diff_files("dev.env", "prod.env", include=["DB_*"])
# Compare dicts directly
report = diff_dicts(dev_config, prod_config)
API
diff_files(left, right, include=None, exclude=None)— Compare config filesdiff_dicts(left, right, include=None, exclude=None)— Compare dictsreport.changes— List ofChangeobjectsreport.added/report.removed/report.modified— Filtered changesreport.summary()— Change count summary
Development
pip install -e .
python -m pytest tests/ -v
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file philiprehberger_config_diff-0.1.4.tar.gz.
File metadata
- Download URL: philiprehberger_config_diff-0.1.4.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
576e4e18025920920c48dabc112634e080fb2d4853d5cdff1e286cfdaaf8a8b8
|
|
| MD5 |
7ee60328bc9306d1708fba5cf8337aa4
|
|
| BLAKE2b-256 |
06003c8001e341fadfb02ca63b7f7f78eb9b5af09e80335f40c8ea858af9fba4
|
File details
Details for the file philiprehberger_config_diff-0.1.4-py3-none-any.whl.
File metadata
- Download URL: philiprehberger_config_diff-0.1.4-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7f773f5d2f0425033e493f4a0296753d84f4c6c5ca0f396beb0856ea4932353b
|
|
| MD5 |
78a334379f2abffe65404b9bc47e160a
|
|
| BLAKE2b-256 |
f1907bd97d51b7431862cd9d815f3f2831aab324dfbfc607d5f19db5f0de496d
|