trailofbits/graphtage is tracked by TopGit as a backend project, with 2.5k stars on GitHub, written primarily in Python. A semantic diff utility and library for tree-like files such as JSON, JSON5, XML, HTML, YAML, and CSV.
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Graphtage is a command-line utility and underlying library
for semantically comparing and merging tree-like structures, such as JSON, XML, HTML, YAML, TOML, plist, and CSS files. Its name is a
portmanteau of “graph” and “graftage”—the latter being the horticultural practice of joining two trees together such
that they grow as one.
Graphtage performs an analysis on an intermediate representation of the trees that is divorced from the filetypes of the
input files. This means, for example, that you can diff a JSON file against a YAML file. Also, the output format can be
different from the input format(s). By default, Graphtage will format the output diff in the same file format as the
first input file. But one could, for example, diff two JSON files and format the output in YAML. There are several
command-line arguments to specify these transformations, such as --format; please check the --help output for more
information.
By default, Graphtage pretty-prints its output with as many line breaks and indents as possible.
{
"foo": [
1,
2,
3
],
"bar": "baz"
}
Use the --join-lists or -jl option to suppress linebreaks after list items:
{
"foo": [1, 2, 3],
"bar": "baz"
}
Likewise, use the --join-dict-items or -jd option to suppress linebreaks after key/value pairs in a dict:
{"foo": [
1,
2,
3
], "bar": "baz"}
Use --condensed or -j to apply both of these options:
{"foo": [1, 2, 3], "bar": "baz"}
The --only-edits or -e option will print out a list of edits rather than applying them to the input file in place.
The --edit-digest or -d option is like --only-edits but prints a more concise context for each edit that is more
human-readable.
Matching Options
By default, Graphtage tries to match all possible pairs of elements in a dictionary.
Matching two dictionaries with each other is hard. Although computationally tractable, this can sometimes be onerous for
input files with huge dictionaries. Graphtage has three different strategies for matching dictionaries:
--dict-strategy match (the most computationally expensive) tries to match all pairs of keys and values between the
two dictionaries, resulting in a match of minimum edit distance;
--dict-strategy none (the least computationally expensive) will not attempt to match any key/value pairs unless
they have the exact same key; and
--dict-strategy auto (the default) will automatically match the values of any key-value pairs that have identical
keys and then use the match strategy for the remainder of key/value pairs.
See Pull Request #51 for some examples of how these strategies
affect output.
The --no-list-edits or -l option will not consider interstitial insertions and removals when comparing two lists.
The --no-list-edits-when-same-length or -ll option is a less drastic version of -l that will behave normally for
lists that are of different lengths but behave like -l for lists that are of the same length.
ANSI Color
By default, Graphtage will only use ANSI color in its output if it is run from a TTY. If, for example, you would like
to have Graphtage emit colorized output from a script or pipe, use the --color or -c argument. To disable color even
when running on a TTY, use --no-color.
HTML Output
Graphtage can optionally emit the diff in HTML with the --html option.
By default, Graphtage prints status messages and a progress bar to STDERR. To suppress this, use the --no-status
option. To additionally suppress all but critical log messages, use --quiet. Fine-grained control of log messages is
via the --log-level option.
Why does Graphtage exist?
Diffing tree-like structures with unordered elements is tough. Say you want to compare two JSON files.
There are limited tools available, which are effectively equivalent to
canonicalizing the JSON (e.g., sorting dictionary elements by key) and performing a standard diff. This is not always
sufficient. For example, if a key in a dictionary is changed but its value is not, a traditional diff
will conclude that the entire key/value pair was replaced by the new one, even though the only change was the key
itself. See our documentation for more information.
Using Graphtage as a Library
Graphtage has a complete API for programmatically operating its diffing capabilities.
When using Graphtage as a library, it is also capable of diffing in-memory Python objects.
This can be useful for debugging Python code, for example, to determine a differential between two objects.
See our documentation for more information.
Extending Graphtage
Graphtage is designed to be extensible: New filetypes can easily be defined, as well as new node types, edit types,
formatters, and printers. See our documentation for
more information.
How active is development on trailofbits/graphtage?
The most recent commit recorded on trailofbits/graphtage was 21 days ago, based on the GitHub push timestamp. The repository has 54 forks — one of the better signals of community interest.
How many stars does trailofbits/graphtage have?
trailofbits/graphtage has 2.5k GitHub stars — refresh the page for the live number, or check github.com/trailofbits/graphtage. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
What else is in the Backend space?
trailofbits/graphtage is tracked by TopGit under the Backend category, alongside 8 GitHub-tagged topics. Trending and Topics pages list peer repositories of comparable stars and language.
What language is trailofbits/graphtage written in?
trailofbits/graphtage is written primarily in Python. GitHub's language field is based on the largest share of bytes in the default branch.
What topics is trailofbits/graphtage associated with?
GitHub's repository topics for trailofbits/graphtage: "command-line-tool", "diff", "graph-algorithms", "hacktoberfest", "hacktoberfest2021", "library", "python", "utility". TopGit's editorial category is Backend.
Where do I read more about trailofbits/graphtage?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/trailofbits/graphtage is the definitive source.
Why is trailofbits/graphtage categorized under Backend?
TopGit places trailofbits/graphtage in the Backend category based on its GitHub topics and description (tagged: "command-line-tool", "diff", "graph-algorithms"). Categories are assigned from real repository metadata, not editorial guesswork.
Read full README in the tab above.
Curious whether graphtage is right for you?
Let ChatGPT, Claude, or Perplexity look into it — click below and see what AI actually says about graphtage.