skillfed

tsdownsample

Time series downsampling in rust

tsdownsample v0.1.5.1 622.3K downloads/30d#5,711 on PyPI234
Permissive license MIT Active released

What it is and what it does

tsdownsample is a Rust-based time series downsampling library that reduces large datasets to a smaller number of points while preserving visual fidelity. It implements four downsampling algorithms—MinMax, M4, LTTB (Largest Triangle Three Buckets), and a hybrid MinMaxLTTB—each returning indices into the original data rather than copies. The library is designed to handle visualization pipelines where rendering millions of points is impractical.

The package depends only on numpy and works with a wide range of numeric types (f16, f32, f64, integers, datetime64, timedelta64, and bool for y-data). It supports optional multithreading via Rayon in Rust, bypassing Python's GIL, and includes variants for handling NaN values. The API is straightforward: instantiate a downsampler class, call its downsample method with your data and desired output count, and use the returned indices to select downsampled points from the original arrays.

Use it for:

  • Downsampling stock price or sensor data with millions of points before plotting in a web dashboard or interactive visualization tool.
  • Preparing large time series datasets for exploratory data analysis without losing visual representation of trends and extrema.
  • Reducing memory footprint and rendering time when displaying high-frequency financial or IoT time series in real-time monitoring applications.
  • Selecting representative points from irregularly sampled time series (e.g., event logs) while preserving important features.
  • Accelerating data pipelines that feed large time series into machine learning models by pre-filtering to key points.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Downsamples large time series datasets to a smaller number of representative points for visualization, using Rust-based algorithms (MinMax, M4, LTTB, MinMaxLTTB) with optional multithreading.

Yes. The package is actively maintained, has no known vulnerabilities, uses a permissive MIT license, and solves a real performance problem for time series visualization. Install friction is moderate but manageable thanks to prebuilt wheels. Choose it if you regularly work with large time series and need fast, memory-efficient downsampling; skip it if your datasets are small or you don't need visualization-specific algorithms.

Install

tsdownsample on PyPI

pip

pip install tsdownsample

uv

uv add tsdownsample

poetry

poetry add tsdownsample

Installing tsdownsample

Before you install

Medium install friction due to compiled wheels; prebuilt binaries available for Python 3.8–3.14 across macOS, Linux (multiple architectures), and Windows, so installation is typically straightforward. Repository is active with recent commits.

License in practice

MIT license is permissive; you can use, modify, and distribute this package freely with minimal restrictions, making it suitable for both open-source and commercial projects.

Quickstart

pip install tsdownsample

from tsdownsample import MinMaxLTTBDownsampler
import numpy as np

y = np.random.randn(10_000_000)
x = np.arange(len(y))
downsampler = MinMaxLTTBDownsampler()
indices = downsampler.downsample(x, y, n_out=1000)
downsampled_x = x[indices]
downsampled_y = y[indices]

Verify before relying

  • Whether the library's performance claims (e.g., 200–300x speedup for f16 argminmax) have been independently validated outside the project.
  • Real-world memory overhead and performance scaling characteristics when working with datasets larger than 10 million points.
  • Behavior and performance when handling time series with significant gaps or irregular sampling rates.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.8)
Install friction medium — platform-specific wheel
Runtime dependencies 1 — numpy
Maintenance actively maintained — 74 days since the last release
Last repo commit
First released
Downloads 622,336/month — #5,711 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: tsdownsample-0.1.5.1-cp310-cp310-macosx_10_12_x86_64.whl; tsdownsample-0.1.5.1-cp310-cp310-macosx_11_0_arm64.whl; tsdownsample-0.1.5.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; tsdownsample-0.1.5.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl; tsdownsample-0.1.5.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; tsdownsample-0.1.5.1-cp310-cp310-manylinux_2_24_armv7l.whl; tsdownsample-0.1.5.1-cp310-cp310-manylinux_2_24_ppc64le.whl; tsdownsample-0.1.5.1-cp310-cp310-manylinux_2_24_s390x.whl; tsdownsample-0.1.5.1-cp310-cp310-musllinux_1_1_aarch64.whl; tsdownsample-0.1.5.1-cp310-cp310-musllinux_1_1_x86_64.whl; tsdownsample-0.1.5.1-cp310-cp310-win32.whl; tsdownsample-0.1.5.1-cp310-cp310-win_amd64.whl; tsdownsample-0.1.5.1-cp311-cp311-macosx_10_12_x86_64.whl; tsdownsample-0.1.5.1-cp311-cp311-macosx_11_0_arm64.whl; tsdownsample-0.1.5.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; tsdownsample-0.1.5.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl; tsdownsample-0.1.5.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; tsdownsample-0.1.5.1-cp311-cp311-manylinux_2_24_armv7l.whl; tsdownsample-0.1.5.1-cp311-cp311-manylinux_2_24_ppc64le.whl; tsdownsample-0.1.5.1-cp311-cp311-manylinux_2_24_s390x.whl

Keywords: time series, downsampling, rust, data science, visualization

Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: MacOS :: MacOS XOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

time series downsamplingdata visualization decimationlarge dataset reductionfast time series samplingLTTB downsamplingminmax downsampling algorithmrust time series processing
time-seriesvisualizationrust-binding

More Information Analysis packages