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

Function / Class Description
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.6.tar.gz (5.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.6-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for philiprehberger_config_diff-0.1.6.tar.gz
Algorithm Hash digest
SHA256 652530434146fcab0db192e2cd4736f6a9accff5282ddb18b6bb9ded687a1d5f
MD5 ec037cbe38422a45143203c3b977eb7a
BLAKE2b-256 683b1c0758f3b426800912e0f1e03583a3eea45efa5f3edb3936e56feecb52bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for philiprehberger_config_diff-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 416c40ad9b56da3d53157b416184c010fc98a7641c5dedd1d0bb2be84e84a88b
MD5 a5b847c2e426638e9987a6c75f8d995e
BLAKE2b-256 f4b30020f7dce5d81fb3947535078c2ee63112aa20cf80f0830b6f87a9a276de

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