skillfed

ddsketch

Distributed quantile sketches

ddsketch v3.0.1 5.8M downloads/30d#2,032 on PyPI92
Permissive license Active released

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 ddsketch

uv

uv add ddsketch

poetry

poetry add ddsketch

Installing 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

License :: OSI Approved :: Apache Software LicenseProgramming Language :: Python :: 3

Tags

quantile estimation streamingdistributed sketch algorithmpercentile calculationmergeable quantile sketchrelative error quantilesstreaming statistics
streaming-statisticsdistributed-computingquantile-sketch

More Information Analysis packages