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 -m=c -o=compressed time_series

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

python -m tacocompression -m=c -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.
  • output (short: o) Provide a directory to save the outputs to.
  • decimals (short: d) Precision of the reconstruction, i.e., number of decimals recoverable during decompression.
  • pairing_function (short: p) One of "rosenberg", "szudzik", and "cantor".

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.2.tar.gz (7.5 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.2-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tacocompression-0.9.2.tar.gz
  • Upload date:
  • Size: 7.5 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.2.tar.gz
Algorithm Hash digest
SHA256 e05f15466b08d5b09b04159c7a5975f14117b2b85b7e6ecd15ff0da0cf4312e8
MD5 b09c8ae5d29b014b0005a99d0c34e704
BLAKE2b-256 feb0d87d514d2fdbf17923e1a3bdc7e552e00be50a7e7b9bf7ec1b9e6c7f686b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tacocompression-0.9.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6e826502b80ff3ca85ebc221497bab2ab0f580f7cd846a256d9f7657861d6ff0
MD5 19d1467d74090cf946f663b15852793d
BLAKE2b-256 c0a144c743e2cd4f141ec87318e3e3546c8068b2751d6edc5111c84b05ef8fc6

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