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.1.tar.gz
(2.2 kB
view hashes)
Built Distribution
Close
Hashes for listcrunch-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3379f83d5538bd46e5bbbad83eeb145f7ece9e06a09fcf98c49bdcfcf6850608 |
|
MD5 | 8eb1e9d16e708354d98e32a3a673bd5c |
|
BLAKE2b-256 | cee90f2a4bfd6d23eabd430f54770565215a30eeb84bd0105237ac4cd3dba9a6 |