Tiny diffs using difflib's SequenceMatcher
Project description
Do you have textual (or binary) data that you need to patch?
` >>> a = 'you say yes, i say no' >>> b = 'you say stop, and i say go go go' `
But you want a smaller patchfile than what difflib’s unified_diff() creates?
` >>> diff = '\n'.join(difflib.unified_diff(a, b)) >>> len(diff) 137 `
mini_patch also uses difflib’s SequenceMatcher machinery, but it creates tiny, ASCII-encoded patches:
` >>> patch = mini_patch.make_mini_patch(a.encode('utf-8'), b.encode('utf-8')) >>> patch '0!d:8,2;i:11,$4$dG9w;i:12,$8$IGFuZA==;r:19,1,$4$Zw==;i:21,$8$IGdvIGdv;' >>> len(patch) 70 `
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mini_patch-1.0.0.tar.gz.
File metadata
- Download URL: mini_patch-1.0.0.tar.gz
- Upload date:
- Size: 2.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.9.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.4.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ddd94c577fe379a937686c6713762324bcaed4de9dd1efe204d72e38b854d8b
|
|
| MD5 |
fcedebce10ecfc9e8792ec42c15f86b2
|
|
| BLAKE2b-256 |
4ecb798a667b55b055472e6673bc7c777113dda29d108c35650140803181d553
|
File details
Details for the file mini_patch-1.0.0-py3-none-any.whl.
File metadata
- Download URL: mini_patch-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.9.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.4.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6a07adbe00621867fbee7f8cf01e2a0adbfafce3641c751064537c011882edee
|
|
| MD5 |
1f1f4760e7bc714c609032a660bc439f
|
|
| BLAKE2b-256 |
fe91b0fbefeec4a3763d6a549aa644c51aaccc91dba9f5c1cfcff9fde1fda862
|
File details
Details for the file mini_patch-1.0.0-py2-none-any.whl.
File metadata
- Download URL: mini_patch-1.0.0-py2-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.9.1 setuptools/40.2.0 requests-toolbelt/0.8.0 tqdm/4.25.0 CPython/3.4.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
99b3cfe6e8db42b25495ac73b00268f00e8376dacada35f9e0f1b4a4d68945be
|
|
| MD5 |
a0629db0bb5afdfb89cb4fed67c26ee5
|
|
| BLAKE2b-256 |
d4f2a6fe1566fcdbbee9cecdd7d2efe838517e50be111048da40d2d92b3c520d
|