--- id: lttb version: "0.3.2" license: unclear license_treatment: permissive maintenance: dormant --- # lttb — Largest-Triangle-Three-Buckets algorithm for downsampling time series-like data License: permissive · Maintenance: dormant · Downloads: 85.6K/mo ## 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 above — verify before relying. Downsamples time series data using the Largest-Triangle-Three-Buckets algorithm to reduce visually redundant points while preserving overall shape, built on numpy. 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 pip install lttb uv add lttb poetry add lttb ## Installing lttb 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. 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) Requires Python 3.8 or later and numpy; input data must be a 2D array with strictly increasing x-values (first column) by default. 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: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 85.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags time series downsampling, reduce data points visualization, lttb algorithm numpy, largest triangle three buckets, time series data compression, visual data filtering, downsample timeseries, time-series, data-reduction, visualization [View on SkillFed](https://skillfed.io/packages/lttb) · [View on PyPI](https://pypi.org/project/lttb/)