YAML-Doctor 🩺📄
Validate – and automatically fix duplicate keys – in Home-Assistant-style YAML files.
No more mysterious “duplicated mapping key” errors breaking your automations!
✨ Features
- Fast validation of any YAML file (Home Assistant, ESPHome, CI pipelines, etc.)
- Smart auto-fix
--fixflag renames duplicate keys in-place (optionally backs up originals) - Colorful Rich output for quick at-a-glance feedback
- Zero-config CLI – just run
yaml-doctor your_file.yaml - Works on Windows, macOS, and Linux (Python ≥ 3.9)
📦 Installation
User install (from PyPI – easiest)
pip install yaml-doctor
🚀 Usage
Goal Command
Validate only yaml-doctor ENTER YOUR FILE.yaml
Validate & auto-fix duplicates yaml-doctor path/to/file.yaml --fix
Show full CLI help yaml-doctor --help
## EXAMPLE
yaml-doctor secrets.yaml --fix
# 🔍 Running validation before fix…
# ❌ Duplicate key “sensor” found at line 12 – renaming to sensor_1
# 🎉 File fixed successfully.
📄 License
MIT © Jason Clark – use it, ship it, enjoy fewer YAML headaches!
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
yaml_doctor-0.1.2.tar.gz
(4.0 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file yaml_doctor-0.1.2.tar.gz.
File metadata
- Download URL: yaml_doctor-0.1.2.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fc6cf4af1cec9d12edb0ad337ab9fe04874432df337e1c7215de6dd515153bca
|
|
| MD5 |
3eccf1bba528864d979aebf18056a7c9
|
|
| BLAKE2b-256 |
5330f1a8160efe34fc6536422b5637ce8f7bd7dc0ba64aab9af62bc21b024681
|
File details
Details for the file yaml_doctor-0.1.2-py3-none-any.whl.
File metadata
- Download URL: yaml_doctor-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ae08cce08c85346d06dbe578e64ffc9ecb9400f41bf755279e1c0de3b55f04a
|
|
| MD5 |
fb6a8f914f0aed85d2ecc087382d2c95
|
|
| BLAKE2b-256 |
fd940e64c5894df4b0c27cae04b7413c92666b019b3059a03cb3dfd469a1bc19
|