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.1.tar.gz
(2.4 kB
view hashes)
Built Distribution
Close
Hashes for listcrunch-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d95b83ef52efac47b86776a8962ae34d81c6835a7e5945f12c1d9c8472bb9fb |
|
MD5 | b3ca6ae5dd103fd0932101f0c84e196b |
|
BLAKE2b-256 | a8a653f105ddc0650e0dea3f3e746803c9c697438e4931996f10e6707438415e |