dotdiff 0.1.0__py3-none-macosx_11_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
Binary file
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: dotdiff
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Classifier: Development Status :: 3 - Alpha
|
|
5
|
+
Classifier: Environment :: Console
|
|
6
|
+
Classifier: Intended Audience :: Developers
|
|
7
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
8
|
+
Classifier: Operating System :: OS Independent
|
|
9
|
+
Classifier: Programming Language :: Rust
|
|
10
|
+
Classifier: Topic :: Utilities
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Summary: Semantic diff for JSON, YAML, TOML, and NDJSON: a structured, agent-friendly change-list instead of line noise.
|
|
13
|
+
Home-Page: https://github.com/rvben/dotdiff
|
|
14
|
+
Author: Ruben J. Jongejan <ruben.jongejan@gmail.com>
|
|
15
|
+
License: MIT
|
|
16
|
+
Requires-Python: >=3.8
|
|
17
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
18
|
+
Project-URL: Homepage, https://github.com/rvben/dotdiff
|
|
19
|
+
Project-URL: Repository, https://github.com/rvben/dotdiff
|
|
20
|
+
|
|
21
|
+
# dotdiff
|
|
22
|
+
|
|
23
|
+
[](https://github.com/rvben/dotdiff/actions/workflows/ci.yml)
|
|
24
|
+
[](https://crates.io/crates/dotdiff)
|
|
25
|
+
[](https://clispec.dev)
|
|
26
|
+
|
|
27
|
+
Semantic diff for JSON, YAML, TOML, and NDJSON. Compares two documents
|
|
28
|
+
*structurally* (not line by line) and prints a path-addressed change list
|
|
29
|
+
instead of textual noise. The sibling of [`dotpick`](https://github.com/rvben/dotpick):
|
|
30
|
+
dotpick extracts fields, dotdiff tells you what changed.
|
|
31
|
+
|
|
32
|
+
## Install
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
cargo install dotdiff
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Usage
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
dotdiff old.json new.json # text on a TTY, JSON when piped
|
|
42
|
+
dotdiff config.yaml config.json # cross-format works
|
|
43
|
+
cat new.json | dotdiff old.json - # `-` reads stdin
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
```text
|
|
47
|
+
$ dotdiff old.json new.yaml
|
|
48
|
+
~ user.plan "free" -> "pro"
|
|
49
|
+
- user.trialEnds "2026-07-01"
|
|
50
|
+
+ user.seats 5
|
|
51
|
+
~ items[0].qty 1 -> 3
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Output is the `~`/`+`/`-` change list on a TTY, and structured JSON when piped:
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
$ dotdiff old.json new.json | jq .
|
|
58
|
+
{"identical": false, "changes": [
|
|
59
|
+
{"op": "changed", "path": "user.plan", "old": "free", "new": "pro"}
|
|
60
|
+
]}
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Paths use [dotpick](https://github.com/rvben/dotpick)'s dotpath vocabulary
|
|
64
|
+
(`user.plan`, `items[2].qty`, `["quoted key"]`), so you can feed a changed path
|
|
65
|
+
straight back into `dotpick` to inspect it.
|
|
66
|
+
|
|
67
|
+
### Matching list items by key
|
|
68
|
+
|
|
69
|
+
By default arrays compare by position, so reordering a list reports everything
|
|
70
|
+
after the move as changed. Pass `--array-key <field>` to match objects in a list
|
|
71
|
+
by an identity field instead - order-independent, and far less noise:
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
# Without: a reordered list looks like 4 changes.
|
|
75
|
+
# With --array-key id: just the one real change.
|
|
76
|
+
$ dotdiff old.json new.json --array-key id
|
|
77
|
+
~ items[id=1].qty 1 -> 3
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
### Formats
|
|
81
|
+
|
|
82
|
+
JSON, YAML, TOML, and NDJSON are detected per file (by extension, then content);
|
|
83
|
+
force both sides with `--format`. NDJSON is compared as an array of records, so
|
|
84
|
+
`--array-key` matches records across two streams. Everything is loaded into one
|
|
85
|
+
model, which is why cross-format diffing works.
|
|
86
|
+
|
|
87
|
+
## Exit codes
|
|
88
|
+
|
|
89
|
+
| code | meaning |
|
|
90
|
+
| --- | --- |
|
|
91
|
+
| `0` | identical |
|
|
92
|
+
| `1` | differences found (the report is on stdout - not an error) |
|
|
93
|
+
| `2` | an input could not be read or parsed |
|
|
94
|
+
| `3` | usage error |
|
|
95
|
+
|
|
96
|
+
Exit `1` is a *data state*, not a failure (the `diff`/`grep` convention), so
|
|
97
|
+
dotdiff is scriptable as a gate: `dotdiff a.json b.json && echo unchanged`.
|
|
98
|
+
|
|
99
|
+
## For agents (clispec)
|
|
100
|
+
|
|
101
|
+
dotdiff follows [The CLI Spec](https://clispec.dev): structured output on
|
|
102
|
+
stdout, structured error envelopes on the last line of stderr, a `schema`
|
|
103
|
+
subcommand whose output validates against `clispec.dev/schema/v0.2.json`
|
|
104
|
+
(checked by the test suite), and the exit-1-on-differences contract declared as
|
|
105
|
+
an `outcome`. It is read-only (`mutating: false`).
|
|
106
|
+
|
|
107
|
+
```sh
|
|
108
|
+
dotdiff schema
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## License
|
|
112
|
+
|
|
113
|
+
MIT
|
|
114
|
+
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
dotdiff-0.1.0.data/scripts/dotdiff,sha256=_ld87HlonQ1Eb-dQSaDwUl76Vq6W4_uSqa_ETjhJJvw,1130416
|
|
2
|
+
dotdiff-0.1.0.dist-info/METADATA,sha256=HrIIduE7fs_yQ-dZnKX-qs1eQZv6vlnKUBAXLesA32Y,3773
|
|
3
|
+
dotdiff-0.1.0.dist-info/WHEEL,sha256=7m8kjhP_K0tQ6qXK8P1IG2YeRznSaoXUEpeK3IfZx-I,102
|
|
4
|
+
dotdiff-0.1.0.dist-info/licenses/LICENSE,sha256=C-fnAxNl5_rkYD0NgIn5gEeZxx-ew8mOfqo_HJk3t4k,1101
|
|
5
|
+
dotdiff-0.1.0.dist-info/sboms/dotdiff.cyclonedx.json,sha256=4NHhCJJXyy9oOperp_19C9KV1IM3Rhh6Hp6EWG4Fzh8,43668
|
|
6
|
+
dotdiff-0.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Ruben J. Jongejan <ruben.jongejan@gmail.com>
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|