fastdigest
A fast t-digest library for Python built on Rust.
What it is and what it does
fastdigest is a Python wrapper around a Rust implementation of the t-digest data structure, designed for computing approximate quantiles and other online statistics on streaming or distributed data. It trades exact computation for speed and memory efficiency, making it suitable for scenarios where you need to estimate percentiles, medians, or trimmed means from large datasets without storing all values in memory.
The package provides methods to initialize a digest from values, incrementally update it with new data (with optional weighting), merge multiple digests together, and query statistics like quantiles, cumulative distribution function values, means, and median absolute deviation. It supports serialization to/from dictionaries and pickle format, and aims for API compatibility with the tdigest library to ease migration.
Use it for:
- Estimate percentiles from streaming sensor or log data without storing all raw values
- Aggregate quantile statistics across distributed compute jobs via digest merging
- Detect anomalies by tracking CDF shifts or trimmed means over time
- Compute real-time analytics dashboards that need fast quantile updates on large datasets
- Replace slower pure-Python t-digest implementations in existing codebases
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
fastdigest provides a Rust-backed t-digest implementation for computing streaming quantiles, percentiles, and online statistics on large or distributed datasets with minimal memory overhead.
Yes. fastdigest is actively maintained, has no security vulnerabilities, carries a permissive MIT license, and offers substantial speed gains (480x faster than tdigest in the documented benchmark) with a straightforward API. Install it if you need streaming quantile estimation or online statistics on large datasets and want a fast, dependency-free solution.
Install
fastdigest on PyPI
pip
pip install fastdigestuv
uv add fastdigestpoetry
poetry add fastdigestInstalling fastdigest
Before you install
Medium install friction due to compiled wheels; prebuilt binaries are available for Python 3.7–3.14 across macOS, Linux (including musl), and Windows architectures. Active maintenance with recent commits; no runtime dependencies.
License in practice
MIT license (permissive); you may use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.
Quickstart
pip install fastdigest
from fastdigest import TDigest
digest = TDigest.from_values(range(1001))
print(digest.quantile(0.99)) # 99th percentile
print(digest.cdf(990)) # rank of value 990
Verify before relying
- Accuracy bounds or error guarantees for quantile estimates compared to exact computation
- Memory consumption scaling with digest size or data distribution
- Whether the package supports Python 3.14 and 3.13 in practice or only declares support
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 152 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 152,643/month — #10,897 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: fastdigest-0.12.0-cp310-cp310-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl; fastdigest-0.12.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; fastdigest-0.12.0-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; fastdigest-0.12.0-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; fastdigest-0.12.0-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl; fastdigest-0.12.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; fastdigest-0.12.0-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl; fastdigest-0.12.0-cp310-cp310-musllinux_1_2_aarch64.whl; fastdigest-0.12.0-cp310-cp310-musllinux_1_2_armv7l.whl; fastdigest-0.12.0-cp310-cp310-musllinux_1_2_i686.whl; fastdigest-0.12.0-cp310-cp310-musllinux_1_2_x86_64.whl; fastdigest-0.12.0-cp310-cp310-win32.whl; fastdigest-0.12.0-cp310-cp310-win_amd64.whl; fastdigest-0.12.0-cp311-cp311-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl; fastdigest-0.12.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; fastdigest-0.12.0-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; fastdigest-0.12.0-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; fastdigest-0.12.0-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl; fastdigest-0.12.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; fastdigest-0.12.0-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl
Keywords: t-digest, tdigest, statistics, quantile, percentile, online learning, streaming, big data, aggregation, real-time analytics, anomaly detection, rust, pyo3
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
tdigestImplements Ted Dunning's t-digest data…
permissive · top 15,000 on PyPI
ddsketchDDSketch computes quantiles (percentiles) of…
permissive · top 5,000 on PyPI
datasketchesProvides streaming algorithms (sketches) for…
permissive · top 5,000 on PyPI
accumulation-treeImplements a red/black tree that stores partial…
permissive · top 15,000 on PyPI
crickCrick provides approximate and streaming…
permissive · top 15,000 on PyPI
quantile-forestQuantile regression forests for estimating…
permissive · top 15,000 on PyPI
tensor-grepA high-performance grep-compatible command-line…
unclear · top 15,000 on PyPI
phonorsPhonors provides Rust-accelerated numerical…
permissive · top 15,000 on PyPI
moviepilot-rustProvides Rust-accelerated parsing and filtering…
unclear · top 15,000 on PyPI
runstatsComputes summary statistics (mean, variance,…
permissive · top 15,000 on PyPI