Metadata-Version: 2.1
Name: sequence-edits
Version: 0.1.8
Summary: Compressed representation of sequence edits
Author-email: Marcel Claramunt <marcel@moveread.com>
Project-URL: repo, https://github.com/moveread/sequence-edits.git
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# Sequence Edits

> Compressed representation of sequence edits


## Edits

```python
class Skip:
  id: int
  tag = 'skip'

class Insert:
  idx: int
  value: T
  tag = 'insert'

Edit = Skip | Insert
```

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

```python
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']
```
