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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for philiprehberger_config_diff-0.1.3.tar.gz
Algorithm Hash digest
SHA256 afcbf8a1bb407d5afa3f9b766630364073ebd17d08070a96b678c0d58e3c1594
MD5 d1987738c545a65e0557b5a541f6e682
BLAKE2b-256 e2c1ea7da1747ab776649a9773213398efd0365c8c2ba5ed22a61cca3472650a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for philiprehberger_config_diff-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 fc849aacd943cb5a4f66e0db169f293cf5a0c8277c4fd88f47e740d2dee8abdd
MD5 cb5ba9622526c0e69b6a0a6fb45f9d25
BLAKE2b-256 8eb904e0c4d5c51f4fbc4e54a111e3d08e99e5c6b6140ecd25071c1ac0e2b607

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