lttb
Largest-Triangle-Three-Buckets algorithm for downsampling time series-like data
Decision gist · record as of 2026-08-14
Yes, if you need to downsample time series for visual display. The package is lightweight, has no complex dependencies, and solves a specific problem well. The dormant maintenance status is not a blocker for stable, mature code, but verify that the algorithm meets your specific data characteristics and that you don't need active support.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.8 or later and numpy; input data must be a 2D array with strictly increasing x-values (first column) by default.
- Low friction: pure Python wheel with only numpy as a runtime dependency.
- Last release was 707 days ago; maintenance is dormant but the package is stable and has been tested against Python 3.12 and numpy 1.25.
License · maintenance · safety
permissive license (permissive) — MIT license (permissive); you can use this freely in commercial and private projects with minimal restrictions.
last release 2024-09-06 (707 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 85,646 downloads/mo, #13,911 on PyPI
Alternatives
Verify before relying
pip install lttb
import numpy as np
import lttb
data = np.array([range(100), np.random.random(100)]).T
small_data = lttb.downsample(data, n_out=20)- Whether the package is actively maintained or accepting contributions despite dormant status.
- Performance characteristics on large datasets (e.g., millions of points).
- Whether custom validators can be easily extended for domain-specific constraints.
What it is and what it does
lttb is a numpy-based implementation of Steinarsson's Largest-Triangle-Three-Buckets algorithm, a data reduction technique specifically designed for visual representation of time series. It removes visually redundant data points while preserving the overall shape and variability, making it useful for rendering plots with fewer points and smaller file sizes. It is not a statistical aggregation or smoothing tool—it's a visual filtering method.
The package provides a single main function, `downsample()`, which takes a 2D array (time values in the first column, metric values in the second) and returns a downsampled version with a specified number of output points. Input validation is configurable: by default it checks for two columns, strictly increasing x-values, and no NaN values, but these checks can be customized or disabled.
Use it for
- Reduce large time series datasets for faster web-based plot rendering without losing visual fidelity.
- Compress financial or stock price time series for display in dashboards or reports.
- Downsample sensor or monitoring data (CPU usage, temperature, etc.) for visualization while retaining trend shape.
- Prepare time series for interactive charting libraries where point count affects performance.
- Filter IoT or real-time metric streams for efficient storage and display of historical data.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to downsample time series for visual display.
The package is lightweight, has no complex dependencies, and solves a specific problem well. The dormant maintenance status is not a blocker for stable, mature code, but verify that the algorithm meets your specific data characteristics and that you don't need active support.
Install
lttb on PyPI
Before you install
Low friction: pure Python wheel with only numpy as a runtime dependency. Last release was 707 days ago; maintenance is dormant but the package is stable and has been tested against Python 3.12 and numpy 1.25.
Requires Python 3.8 or later and numpy; input data must be a 2D array with strictly increasing x-values (first column) by default.
License in practice
MIT license (permissive); you can use this freely in commercial and private projects with minimal restrictions.
Quickstart
pip install lttb
import numpy as np
import lttb
data = np.array([range(100), np.random.random(100)]).T
small_data = lttb.downsample(data, n_out=20)
Verify before relying
- Whether the package is actively maintained or accepting contributions despite dormant status.
- Performance characteristics on large datasets (e.g., millions of points).
- Whether custom validators can be easily extended for domain-specific constraints.
Package facts
| License | permissive license permissive |
| Python support | Supports the current Python release ~=3.8 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packagenumpy |
| Maintenance | Dormant 707 days since the last release |
| First released | |
| Downloads | 85,646 / month, #13,911 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaIntended Audience :: Financial and Insurance IndustryIntended Audience :: Information TechnologyIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentTopic :: Office/Business :: Financial :: InvestmentTopic :: Scientific/Engineering :: Visualization |
Evidence: lttb-0.3.2-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “reduce data points visualization”
- lttbDownsamples time series data using the Largest-Triangle-Three-Buckets…
- rdpImplements the Ramer-Douglas-Peucker algorithm to reduce the number…
- tsdownsampleDownsamples large time series datasets to a smaller number of…
Give your agent the search over MCP, or paste the wish link into any chat.
More Visualization packages
matplotlib creates static, animated, and interactive visualizations in Python, producing publication-quality figures in multiple formats for scripts, shells, web servers, and graphical interfaces.
Install it if you need to visualize data, generate publication-quality figures, or embed plots in applications.
ContourPy calculates contours of 2D quadrilateral grids using C++11 algorithms wrapped in Python, offering serial and multithreaded implementations without requiring Matplotlib as a dependency.
Plotly is an interactive, browser-based graphing library that creates charts and visualizations from Python, rendering them as HTML that can be viewed in Jupyter notebooks, standalone files, or web applications.
Generates DOT language source code for graph structures and renders them using the Graphviz graph drawing software installed on your system.
Install it if you need to generate or render graphs from Python.
Streamlit transforms Python scripts into interactive web applications with minimal code, enabling rapid development of data dashboards, reports, and chat interfaces without requiring web development expertise.
Leather is a lightweight Python charting library for quick, no-frills data visualization. It generates charts without requiring perfect styling or extensive configuration.
See also tsdownsample · rdp · stumpy · plotly-resampler · dtw-python · pytorch-forecasting · dtaidistance · tslearn · dbl-tempo · time-aware-imputer