Skip to main content

what-the-diff

"What the diff???"

unix diff implementation in python

Usage

from what_the_diff import diff
old = "Hello world\nHello hell"

new = "Hello Heaven\nHello world\nHello hall\nHello waddldo"

lines_new = new.split('\n')
lines_old = old.split('\n')


removed, added, updated = diff(old, new)

for i in removed:
    print(i.format())
for i in added:
    print(i.format())
for i in updated:
    print(i.format())

#prints
#0,1d1
#< Hello hell
#0a1,1
#> Hello Heaven
#2a3,4
#> Hello hall
#> Hello waddldo
#1c2
#< Hello hell
#---
#> Hello hall
#### With colors

Install

pip install what-the-diff

Metadata

Release files for what-the-diff 0.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 what-the-diff 0.1
File Size Uploaded
what_the_diff-0.1.tar.gz 3.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for what-the-diff 0.1
File Interpreter ABI Platform
what_the_diff-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 8.1 kB

Release files / what_the_diff-0.1.tar.gz

Download URL what_the_diff-0.1.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e0841340cbbe1486e27521b4cdab97c8e5ab265a61bfde780644d57f5cd23e83
BLAKE2b-256 checksum
How to use checksums
12dfd8b0812010dc21cdfb92486f6dff21e6915c56998b1ff5f32d8b3ad9d256
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.32.2 CPython/3.7.4

Release files / what_the_diff-0.1-py3-none-any.whl

Download URL what_the_diff-0.1-py3-none-any.whl
Size 4.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d07f4615777b579ebdb050e2339d260c5e1022640a17f2c81f811c4aadf4a656
BLAKE2b-256 checksum
How to use checksums
5153f71016a13ef2a2be93644c1357f3d659ae23b47d5f9868d9dfdd02c6b117
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.32.2 CPython/3.7.4

Release history Release notifications | RSS feed

This release

0.1 This release

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