Skip to main content

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 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

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.0.tar.gz (4.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.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for philiprehberger_config_diff-0.1.0.tar.gz
Algorithm Hash digest
SHA256 1b294bbcdab4f8323329ae97e5f29e5292ae94c23d471adb2a9db40ea353b313
MD5 2e3154749045984e85cfbd61a03a5bb3
BLAKE2b-256 6169f72a9d83f038c95c7cabe5f4016c23f01b2404c3250c6f358359493b9915

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for philiprehberger_config_diff-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4a64858c3850fb24992c86622abd25c0ceaf48f8b26c2053a1947bbd9870075d
MD5 8d94b6cc8ac408cdcf9fd31195591d94
BLAKE2b-256 35db12524900ff79b23ca55aa7c516b2a6de068e2859b50be4742eded755aaba

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