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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for philiprehberger_config_diff-0.1.4.tar.gz
Algorithm Hash digest
SHA256 576e4e18025920920c48dabc112634e080fb2d4853d5cdff1e286cfdaaf8a8b8
MD5 7ee60328bc9306d1708fba5cf8337aa4
BLAKE2b-256 06003c8001e341fadfb02ca63b7f7f78eb9b5af09e80335f40c8ea858af9fba4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for philiprehberger_config_diff-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 7f773f5d2f0425033e493f4a0296753d84f4c6c5ca0f396beb0856ea4932353b
MD5 78a334379f2abffe65404b9bc47e160a
BLAKE2b-256 f1907bd97d51b7431862cd9d815f3f2831aab324dfbfc607d5f19db5f0de496d

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