Skip to main content

Compare configuration files across environments

Project description

philiprehberger-config-diff

Tests PyPI version License

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 files
  • diff_dicts(left, right, include=None, exclude=None) — Compare dicts
  • report.changes — List of Change objects
  • report.added / report.removed / report.modified — Filtered changes
  • report.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

philiprehberger_config_diff-0.1.5.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

philiprehberger_config_diff-0.1.5-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file philiprehberger_config_diff-0.1.5.tar.gz.

File metadata

File hashes

Hashes for philiprehberger_config_diff-0.1.5.tar.gz
Algorithm Hash digest
SHA256 047fd7b2ca6f8555eb2072fae8dc17611452c4ee5ee86b820689ae9aeb6abe9b
MD5 19af2509f2632e895103a442448e4a4d
BLAKE2b-256 338899a7a4f7493da3ef0f687aea2abdaf19c1c4e77e010ae4e698c9d8c45064

See more details on using hashes here.

File details

Details for the file philiprehberger_config_diff-0.1.5-py3-none-any.whl.

File metadata

File hashes

Hashes for philiprehberger_config_diff-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 130f29f448bd6dd67033d9237574368d9842e6ac8e8f76d5df0cc047f2de55ef
MD5 72de579490b6c5a605925a412cfcb2ed
BLAKE2b-256 ca1ac61be73c4ed2d32ceb1ff243aaa3b3a547dc25938babe1287a62fbc40192

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page