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.5.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.5-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tacocompression-0.9.5.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.5.tar.gz
Algorithm Hash digest
SHA256 2cbbcb1999e7ef6185b4872dc50300946e0952cabaf827e3f4ecf5ba05ef5127
MD5 ff7c364dde29c12c7b365a9a83bd76fa
BLAKE2b-256 929400395722e373bb02a27f24f81a403e8eaeeead178c1514e703c8e9130055

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tacocompression-0.9.5-py3-none-any.whl
Algorithm Hash digest
SHA256 d606fc571f0f975ef4c6049eda6263163ebcf27425971ba7cc59228059c1bf5f
MD5 fa5b926d1f2a65c345c6bfbbd3dfa419
BLAKE2b-256 4bedf347ae148b2a0637aac85d22fcf1188ec09abc08068442388ff38015c9a4

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