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

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.2.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.2-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for philiprehberger_config_diff-0.1.2.tar.gz
Algorithm Hash digest
SHA256 0e694fc1082abfaa668aa5eb147c7c955946dd7e69226b6271b85bdc31ba366e
MD5 0157b8eac6ba1df125bce9876a3e0e9d
BLAKE2b-256 43aeac74b3eac199cdc6315d0c5d87e91372809ac2d6c74bf21b06f4646e188b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for philiprehberger_config_diff-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b46919aff392601600d5baaf367fe56c128b8e481559667e655fe6c5566edc69
MD5 a2f461cc5c2aa04dacd3561a237599bc
BLAKE2b-256 1083a2086779361f8d7c29bc4dbcf7dce8c95e915aaf1e54796871bae886f282

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