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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for philiprehberger_config_diff-0.1.1.tar.gz
Algorithm Hash digest
SHA256 5fdc700e045cb5cea56eb872900f9d9402636190abccce2bf4e44581f81f0e3c
MD5 a9fc7dd1ad922a08484927eb4d153d19
BLAKE2b-256 a640071aa293a23aca9f594b7d7188c0e786f98c6e585bed864ba134be93aa7f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for philiprehberger_config_diff-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 20dca6cd733085907c64f204397bf3697fa3811c7a96020d3f0d8e67377bd710
MD5 59430e807d3d8d15433740e5ded6ceb3
BLAKE2b-256 4a1ad7917b9e446af7f7bbbf524a07963dcba1d7b0aaa2b6611db167db28949b

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