| Crates.io | py-fossil-delta |
| lib.rs | py-fossil-delta |
| version | 0.1.3 |
| created_at | 2019-07-09 07:25:29.991067+00 |
| updated_at | 2023-01-14 15:53:45.682186+00 |
| description | Provides functions for calculating differences between strings and applying calculated deltas |
| homepage | |
| repository | https://github.com/vitalije/fossil-delta.git |
| max_upload_size | |
| id | 147774 |
| size | 4,348 |
This crate exports functions fossil_delta::delta and fossil_delta::deltainv to
Python interepreter. The resulting library built with:
cargo build --release
on Linux is named libfossil_delta.so. Before using in Python it has to be renamed
to fossil_delta.so. On Windows it should be probably renamed to fossil_delta.pyd
or fossil_delta.dll.
>>> import fossil_delta
>>> a = """line 1
... yet another (a bit longer) line 2
... yet another (a bit longer) line 3
... yet another (a bit longer) line 4
... yet another (a bit longer) line 5
... yet another (a bit longer) line 6
... yet another (a bit longer) line 7
... yet another (a bit longer) line 8
... yet another (a bit longer) line 9
... yet another (a bit longer) line 10"""
...
>>> b = """line 1
... yet another (a bit longer) line 2
... yet another (a bit longer) line 3
... yet another (a bit longer) line 4
... yet another (a bit longer) line 5
... yet another (a bit longer) line 6
... yet another (a bit longer) line 7
... yet another (a bit longer) line 8
... and finally last line 10
... yet another (a bit longer) line 9
... yet another (a bit longer) line 10"""
...
>>> d = fossil_delta.delta(a, b)
>>> s = fossil_delta.deltainv(b, d)
>>> s == a
True
>>>