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.0.2.tar.gz
(2.2 kB
view hashes)
Built Distribution
Close
Hashes for listcrunch-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6982a5f0e4e34662b0feaefe0dbef768aa0724fcd750aad691a12cb13a1604cc |
|
MD5 | 9039148f272999950c0a5f6cec229cf6 |
|
BLAKE2b-256 | e0a928d1227fb7fae9abe9c4c0c6690d733657cf715b5a03c7c0cfb0e9005eac |