Skip to main content

Implementation of TACO: A Lightweight Tree-Based Approximate Compression Method for Time Series

Project description

taco-compression

This is the official implementation of the TACO compression algorithm for time series [1].

Installation

Please install via pip:

pip install tacocompression

Usage

There are two usage modes, one as a command line tool operating on files, the other as callables from within python.

Command Line

Please use python -m tacocompression to (de)compress your time series from the command line interface. This application takes 4 named keyword arguments and at least one additional argument specifying the input(s). These inputs are the paths to the files/directory of the (compressed) time series. You can either specify a directory from which all csv files are read...

python -m tacocompression -o=compressed time_series

... or by passing the paths to the files directly.

python -m tacocompression -o=. data/time_series_1.csv data/time_series_2.csv

Each file must contain a single column interpreted as a univariate time series. We assume row 0 is the header. The compressed data is saved in csv files as well.

The keyword arguments are

  • mode (short: m) Use c to compress and d to decompress. Defaults to c.
  • output (short: o) Provide a directory to save the outputs to.
  • pairing_function (short: p) One of "rosenberg", "szudzik", and "cantor". Defaults to "rosenberg".
  • decimals (short: d) Precision of the reconstruction, i.e., number of decimals recoverable during decompression. Only used in compression. Defaults to 1.
  • header. Whether the input file(s) contain a header. Only used in compression. Set only if true.

To decompress the above time series, use

python -m tacocompression -m=d -o=time_series compressed

respectively

python -m tacocompression -m=d -o=data compressed_time_series_1.csv compressed_time_series_2.csv

As a Callable

from tacocompression import compress, decompress

# 2 univariate time series, length 10 and 8:
time_series = [[0.0, 1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9.9], [8.8, 7.7, 6.6, 5.5, 4.4, 3.3, 2.2, 1.1]]

compressed = compress(time_series, "szudzik", 1)
reconstructed = decompress(compressed, "szudzik")

assert time_series == reconstructed

[1] Bauer, André. TACO: A Lightweight Tree-Based Approximate Compression Method for Time Series. In: Proceedings of the 14th International Conference on Data Science, Technology and Applications (DATA 2025), pages 182-190. 2025.

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

tacocompression-0.9.6.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tacocompression-0.9.6-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file tacocompression-0.9.6.tar.gz.

File metadata

  • Download URL: tacocompression-0.9.6.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.11

File hashes

Hashes for tacocompression-0.9.6.tar.gz
Algorithm Hash digest
SHA256 cfc3046cf5d4c7e081b1f215e19c7e73506179dd543abdd9466ec4b5edf3f0ef
MD5 9185e0f14652ca4bdde6a32594c430cd
BLAKE2b-256 479cef8edfdc174050ce651d38097a4c0118158a5592940c61f72eb94ddbe48a

See more details on using hashes here.

File details

Details for the file tacocompression-0.9.6-py3-none-any.whl.

File metadata

File hashes

Hashes for tacocompression-0.9.6-py3-none-any.whl
Algorithm Hash digest
SHA256 34fa459580884ae1c60d5d01e1b9786b3fa6ae61f11f1ec74af2d05fc0d7f83a
MD5 7ba85c788cd5dafe459af6299878c04c
BLAKE2b-256 d2ef5b5c67d19936be821809f2bda4f49b963026d5b1c32dea47e8ac1865b7c4

See more details on using hashes here.

Supported by

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