listcrunch is a Python utility library (current version 1.0.1) that provides a simple, human-readable way to compress redundant sequential data within lists into a string format, and to decompress it back. It is a stable, focused library with no active new feature development since its last release in 2020.
pip install listcrunchVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use the `crunch` function to compress a list of sequential, redundant data into a human-readable string format, and then use the `uncrunch` function to restore the original list. The output format `VALUE:START-END;...` indicates that 'VALUE' appears from 'START' index to 'END' index (inclusive) in the original list.
Ensure input to `crunch` is a list of hashable elements where sequential compression makes sense. For lists of unhashable objects, you might need to process them into a hashable representation first.
Always use the `uncrunch` function for decompression to ensure forward compatibility and robust parsing of the compressed format.
If encountering unexpected behavior with very old or new Python versions, test within a Python 3.7+ environment. Report any compatibility issues to the library's GitHub repository.
Run `pip install listcrunch` in your terminal to install the library.
Ensure you are importing the functions correctly using `from listcrunch import crunch, uncrunch` and that no other variables in your scope share these names.
Verify that the string passed to `uncrunch` was either originally produced by the `crunch` function or meticulously follows its specified format.
No dependency data recorded yet.