Tools for encoding/decoding sequence editions (insertions/deletions) in compact format
Project description
Sequence Edits
Tools for encoding/decoding sequence editions (insertions/deletions) in compact forma
Edits
class Skip:
idx: int
class Insert:
idx: int
value: T
All edits are applied w.r.t. the original list. So, order of edits only affects the order in which values are insterted to a same index.
Usage
import sequence_edits as se
edits = [
se.Insert(idx=1, value='the'),
se.Skip(idx=4)
]
xs = ['And', 'earth', 'was', 'without', 'no', 'form']
list(se.apply(edits, xs))
# ['And', 'the', 'earth', 'was', 'without', 'form']
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for sequence_edits-0.1.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 214c4932e9d85af857cc7a1e0c48c99ed6b8fb47d0fa76e41ad8e10ab128321f |
|
MD5 | b224e292e8eb9557ff0f5520453d954b |
|
BLAKE2b-256 | 728d9aff8ded550eacb7005aaace447c71025f05f0a6f69802165aa081b5fec1 |