A simple human-readable way to compress redundant sequential data
Project description
ListCrunch
A simple human-readable way to compress redundant sequential 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
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-1.0.0.tar.gz
(2.3 kB
view hashes)
Built Distribution
Close
Hashes for listcrunch-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39462e05b55f1e620f22fd901f7f3b29cbe634f6795c52ea9c90bf4dcbe7094c |
|
MD5 | f4a140d61e30de2622249c2606749864 |
|
BLAKE2b-256 | 5b1d9cc1d47880cc546ec9e9856d4bba3a7cc9cd6ef137a69f08d7750ab42e00 |