py-fossil-delta

Crates.iopy-fossil-delta
lib.rspy-fossil-delta
version0.1.3
sourcesrc
created_at2019-07-09 07:25:29.991067
updated_at2023-01-14 15:53:45.682186
descriptionProvides functions for calculating differences between strings and applying calculated deltas
homepage
repositoryhttps://github.com/vitalije/fossil-delta.git
max_upload_size
id147774
size4,348
Виталије Милошевић (vitalije)

documentation

README

fossil_delta a Python extension

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.

Usage:

>>> 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
>>>
Commit count: 55

cargo fmt