Skip to main content

json-pretty-diff

LinkedIn GitHub Buy Me a Coffee

Made with love by Javier Lianes García in Aranjuez ❤️

This project is stable. Bug fixes will be released as issues are reported.

Overview

Generate a clean HTML report that summarizes the top-level differences between two JSON files. The report groups keys into Added, Removed, and Changed sections to make the impact of the updates easy to scan.

Installation

From PyPI (recommended)

  1. Ensure Python 3.9 or newer is available on your system.
  2. Install the package:
    pip install json-pretty-diff
    
  3. Run the CLI to compare two JSON files:
    jpd original.json updated.json -o diff.html
    
  4. Open diff.html in your browser to explore the report.

From source

  1. Clone this repository.
  2. Install the package in editable mode:
    pip install -e .
    

Usage

Run the command-line tool and point it to the files you want to compare:

jpd A.json B.json -o diff.html

Options

Flag Description
-o, --output Path to the output HTML file. When omitted, HTML is printed to stdout.
--open Open the generated HTML report in the default browser (requires -o).
-q, --quiet Suppress all output except errors.
--no-style Generate HTML without CSS styles (lighter output).
--version Show program version and exit.

Exit codes

  • 0: no differences were detected (an HTML report is still generated showing "No differences").
  • 1: differences were found and the HTML describes every change.
  • 2: an error occurred (missing file, invalid JSON, or a root element that is not a JSON object) and no HTML report is produced.

Example

jpd fixtures/base.json fixtures/update.json -o reports/diff.html

The file diff.html will contain one section per change category with simple styles that highlight added, removed, or modified keys.

Limitations

  • Only the first-level keys are compared (no recursive diff).
  • There are no exclusions, tolerances, or advanced configuration flags.
  • Console output never uses ANSI colors.
  • There is no CI/CD integration or bundled automated test suite.

Metadata

Release files for json-pretty-diff 1.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for json-pretty-diff 1.1.1
File Size Uploaded
json_pretty_diff-1.1.1.tar.gz 17.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for json-pretty-diff 1.1.1
File Interpreter ABI Platform
json_pretty_diff-1.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 39.0 kB

Release files / json_pretty_diff-1.1.1.tar.gz

Download URL json_pretty_diff-1.1.1.tar.gz
Size 17.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e540fdd9ac0974bb64dbe0891b8a63333dd64044982fbffa535ad6e6826721fb
BLAKE2b-256 checksum
How to use checksums
f7954644d49bf75ebb938b9f0e9e89ada7b3700c3ce839a0a6c3b49524483638
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release files / json_pretty_diff-1.1.1-py3-none-any.whl

Download URL json_pretty_diff-1.1.1-py3-none-any.whl
Size 21.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c6c9f54dc19e93d3807b6ec924d866d7c4849cb79dd5c02dc60df1ed47e286ec
BLAKE2b-256 checksum
How to use checksums
f6181fddc099376f15ef8d0de0dcfe62f1952d29cb4a2c2d14db2e95fb18237e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.11.15

Release history Release notifications | RSS feed

This release

1.1.1 This release

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page