ddsketch
Distributed quantile sketches
What it is and what it does
DDSketch is a Python implementation of a distributed quantile sketch algorithm that estimates any quantile of a dataset while guaranteeing a bounded relative error. The default relative error is set to 0.01, meaning if the true quantile is x, the sketch returns a value y such that the relative difference stays within that bound. Instead of storing all data points, it maintains a compact sketch that grows predictably even for large datasets with sub-exponential tails.
The package is designed for distributed systems: you can create sketches on different nodes, add data to each independently, and then merge them into a central sketch to compute accurate quantiles across the combined dataset. It provides a standard DDSketch implementation plus variants (LogCollapsingLowestDenseDDSketch and LogCollapsingHighestDenseDDSketch) that trade accuracy guarantees for different quantile ranges, with configurable bin counts (default m = 2048) to tune memory versus precision.
Use it for:
- Computing percentiles of request latencies across distributed services without storing all raw measurements.
- Estimating quantiles of financial data or sensor readings where you need bounded error but cannot afford to keep every data point.
- Merging quantile summaries from multiple data sources or time windows to compute aggregate statistics.
- Monitoring systems where you need to track tail latencies with minimal memory overhead.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
DDSketch computes quantiles (percentiles) of streaming or batch data with guaranteed relative error bounds, and supports merging sketches from distributed systems into a single combined sketch.
Yes. DDSketch is actively maintained, has no known vulnerabilities, installs with minimal friction, and solves a specific problem (distributed quantile estimation with error guarantees) that is difficult to implement correctly from scratch. Use it if you need accurate percentile estimates from streaming or distributed data without storing raw values.
Install
ddsketch on PyPI
pip
pip install ddsketchuv
uv add ddsketchpoetry
poetry add ddsketchInstalling ddsketch
Before you install
Low friction: pure Python wheel with a single lightweight runtime dependency (six). Actively maintained with recent commits and no known vulnerabilities.
License in practice
Permissive license allows commercial and private use with minimal restrictions.
Quickstart
pip install ddsketch
from ddsketch import DDSketch
sketch = DDSketch()
for value in [1.0, 2.5, 3.7, 5.2]:
sketch.add(value)
median = sketch.get_quantile_value(0.5)
Requires Python 3.7 or later.
Verify before relying
- Whether numpy is a runtime dependency or only a development/optional dependency (description mentions it but fact sheet lists only six).
- Performance characteristics for very large datasets or high-frequency streaming scenarios.
- Real-world use cases for tail latency monitoring and typical quantile queries in production systems.
Package facts
| License | not declared (permissive) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — six |
| Maintenance | actively maintained — 865 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 5,822,808/month — #2,032 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ddsketch-3.0.1-py3-none-any.whl
Keywords: ddsketch, quantile, sketch
Tags
More Information Analysis packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyarrowpyarrow provides Python bindings to Apache…
permissive · top 100 on PyPI
networkxNetworkX provides data structures and…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
contourpyContourPy calculates contours of 2D…
permissive · top 1,000 on PyPI
snowflake-snowpark-pythonSnowpark Python provides APIs to query and…
permissive · top 1,000 on PyPI
datasketchesProvides streaming algorithms (sketches) for…
permissive · top 5,000 on PyPI
fig2sketchConverts Figma .fig design files into Sketch…
unclear · top 15,000 on PyPI
fastdigestfastdigest provides a Rust-backed t-digest…
permissive · top 15,000 on PyPI
tdigestImplements Ted Dunning's t-digest data…
permissive · top 15,000 on PyPI
datasketchProvides probabilistic data structures…
permissive · top 5,000 on PyPI
quantile-forestQuantile regression forests for estimating…
permissive · top 15,000 on PyPI
madokaMadoka implements a Count-Min sketch data…
permissive · top 15,000 on PyPI
whylogs-sketchingProvides Python bindings to Apache…
permissive · top 15,000 on PyPI
ddtraceddtrace instruments Python applications to send…
permissive · top 1,000 on PyPI