A simple human-readable way to compress redundant sequential numerical data
Project description
ListCrunch
A simple human-readable way to compress redundant sequential numerical data.
Example
from listcrunch import crunch
compressed_string = crunch([1, 1, 1, 1, 1, 1, 1, 1, 1, 2])
# Returns '1:0-8;2:9', meaning 1 appears in indices 0-8 (inclusive),
# and 2 occurs at index 9.
To uncompress, use the uncrunch
function.
from listcrunch import uncrunch
assert uncrunch('50:0-1,3-4;3:2,5;60:6;70:7-8')
# Returns [50, 50, 3, 50, 50, 3, 60, 70, 70]
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
listcrunch-0.1.0.tar.gz
(2.2 kB
view hashes)
Built Distribution
Close
Hashes for listcrunch-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53f50758f11264d27341544ece2572d457ca62b33260f2f0662bbd09d0e4d048 |
|
MD5 | 1e39929ee265e176fd8766a7dd243510 |
|
BLAKE2b-256 | 06845a874d77e65aeead96f1527c3deb8068409de26c982af4676e7891a84c7a |