Skip to main content

Tools for encoding/decoding sequence editions (insertions/deletions) in compact forma

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 Distribution

sequence_edits-0.1.6.tar.gz (2.4 kB view hashes)

Uploaded Source

Built Distribution

sequence_edits-0.1.6-py3-none-any.whl (3.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page