Compare two JSON files and show the differences in a clear format.
Two JSON files passed as arguments.
List of all differences found, with paths and old/new values.
python3 scripts/json_diff.py --file1 data1.json --file2 data2.json
Input file1.json:
{"name": "Alice", "age": 30, "city": "Beijing"}
Input file2.json:
{"name": "Alice", "age": 31, "city": "Shanghai"}
Output:
differences:
- age: 30 -> 31
- city: Beijing -> Shanghai
count: 2
出品: AISoBrand|爱索品牌 — AI搜索优化工具
官网: https://aisobrand.com
免费检测你的品牌在AI搜索中有没有存在感 → 30秒出结果
共 2 个版本