Skip to main content

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 details)

Uploaded Source

Built Distribution

listcrunch-1.0.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file listcrunch-1.0.1.tar.gz.

File metadata

  • Download URL: listcrunch-1.0.1.tar.gz
  • Upload date:
  • Size: 2.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/47.2.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.6

File hashes

Hashes for listcrunch-1.0.1.tar.gz
Algorithm Hash digest
SHA256 2b90aa04196061976baaf642868178edcba85826da2845a452530df8596d006e
MD5 85fdbe7efd957a77dd1cbef121b4767a
BLAKE2b-256 8beb32b182f866b37af53c01c3a7845909f9f56462f614c12bf9c90de79442f4

See more details on using hashes here.

File details

Details for the file listcrunch-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: listcrunch-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/47.2.0 requests-toolbelt/0.9.1 tqdm/4.38.0 CPython/3.7.6

File hashes

Hashes for listcrunch-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2d95b83ef52efac47b86776a8962ae34d81c6835a7e5945f12c1d9c8472bb9fb
MD5 b3ca6ae5dd103fd0932101f0c84e196b
BLAKE2b-256 a8a653f105ddc0650e0dea3f3e746803c9c697438e4931996f10e6707438415e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page