Skip to main content

Unix diff implementation in python

Project description


"What the diff???"

unix diff implementation in python


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:
for i in added:
for i in updated:

#< Hello hell
#> Hello Heaven
#> Hello hall
#> Hello waddldo
#< Hello hell
#> Hello hall
#### With colors


pip install what-the-diff

Project details

Release history Release notifications | RSS feed

This version


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for what-the-diff, version 0.1
Filename, size File type Python version Upload date Hashes
Filename, size what_the_diff-0.1-py3-none-any.whl (4.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size what_the_diff-0.1.tar.gz (3.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page