Skip to content

About

Compare nested JSON and TOML configuration files and report added, removed, and changed values by dotted key path.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Config Diff banner Typing title

License Language Stars Last commit

Config Diff illustration

🧭 Overview

Config Diff makes configuration reviews easier by comparing nested JSON or TOML files and showing exactly which paths were added, removed, or changed. It can emit JSON for automation and return a failing exit code when changes are found.

✨ Features

  • 🧭 Flatten nested objects into readable dotted paths
  • ➕ Report added, removed, and changed values
  • 📄 Read JSON and TOML without third-party libraries
  • 🚫 Ignore selected path prefixes
  • ⚙️ Return a non-zero exit code when CI should fail on any difference

🎬 Demo

python main.py config-old.json config-new.json
python main.py settings.toml settings-next.toml --json

The text report uses +, -, and ~ markers for added, removed, and changed paths.

🚀 Quick Start

Requires Python 3.11+ for the built-in TOML parser.

python main.py before.json after.json
python main.py before.toml after.toml --ignore-prefix logging --fail-on-change
python -m unittest discover -s tests

🧰 Tech Stack

  • 🐍 Python 3.11+
  • 📄 json and tomllib
  • 🧪 unittest

🗂️ Folder Structure

config-diff/
├── assets/overview.svg
├── tests/test_main.py
├── main.py
├── requirements.txt
├── .gitignore
└── README.md

🗺️ Roadmap

  • 🧩 Add YAML support as an optional extra
  • 📊 Add a compact summary by change type
  • 🧪 Add allowlist files for ignored paths

🤝 Contributing

Bug reports and focused pull requests are welcome. Include a reproducible example or a test when changing behavior.

📄 License

MIT — see LICENSE.

Animated wave footer

About

Compare nested JSON and TOML configuration files and report added, removed, and changed values by dotted key path.

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages