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.2.0.tar.gz
(2.4 kB
view hashes)
Built Distribution
Close
Hashes for listcrunch-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97f0b8016c4382f1439c7f551b1aa69636049048f5dc568f7f5f5f85ec29b712 |
|
MD5 | 53781067f56ad1f41c57063fc444553f |
|
BLAKE2b-256 | 64815b39c0403ed87fbcdead9bc7ba43a6661c89368713a9c295731430f704d4 |