rddsketch
Python bindings, via PyO3, for
sketches-ddsketch —
a Rust port of DataDog's Go/Java DDSketch
implementations. A near-drop-in, faster replacement for DataDog's official
ddsketch Python package.
Install
pip install rddsketch
Prebuilt wheels (Linux/macOS/Windows, Python 3.11+) via abi3, no Rust
toolchain needed at install time.
Usage
from rddsketch import DDSketch
s = DDSketch(relative_accuracy=0.01) # default: 1% relative error
s.add(12.3)
s.add(45.6)
s.quantile(0.5) # -> float | None
s.count, s.sum, s.min, s.max
s2 = DDSketch(relative_accuracy=0.01)
s2.add(100.0)
s.merge(s2) # in-place, requires matching config
s3 = s.copy()
data = s.to_bytes()
restored = DDSketch.from_bytes(data, relative_accuracy=0.01)
add/quantile/get_quantile_value/merge/count/sum/min/max
match ddsketch.DDSketch directly. Differences: no weight param on
add, constructor args and serialization format differ, avg is an added
convenience property.
Benchmarks
Single-threaded, release build, rddsketch vs. ddsketch:
| n | rddsketch | ddsketch | speedup |
|---|---|---|---|
| 10,000 | 0.001s | 0.012s | 14.9x |
| 100,000 | 0.009s | 0.069s | 7.4x |
| 1,000,000 | 0.084s | 0.642s | 7.6x |
| 10,000,000 | 0.795s | 6.741s | 8.5x |
Quantile accuracy is identical (same algorithm). Memory usage is similar
for a single sketch; for many independent sketches rddsketch uses
meaningfully less. Full numbers and methodology:
benchmarks/results.md.
Design notes
- Algorithm:
sketches-ddsketchdoes the real work; this crate validates inputs and wraps it for Python. - Bin store: dense, collapsing, bounded by
max_num_bins(default 2048, matchingLogCollapsingLowestDenseDDSketch) — not the unboundedddsketch.DDSketch. - Serialization:
to_bytes()/from_bytes()use DataDog's Java-compatible binary encoding unmodified.from_bytes()needsrelative_accuracypassed back in — it can't be recovered from the bytes alone. - No
weightparam: the underlying store counts unweighted.
Metadata
Release files for rddsketch 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| rddsketch-0.0.1.tar.gz | 16.7 kB | With provenance | Details for rddsketch-0.0.1.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| rddsketch-0.0.1-cp311-abi3-win_amd64.whl | CPython 3.11 | abi3 | Windows x86-64 | Details for rddsketch-0.0.1-cp311-abi3-win_amd64.whl |
| rddsketch-0.0.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.11 | abi3 | Linux glibc 2.17+ x86-64 | Details for rddsketch-0.0.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
| rddsketch-0.0.1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.11 | abi3 | Linux glibc 2.17+ ARM64 | Details for rddsketch-0.0.1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
| rddsketch-0.0.1-cp311-abi3-macosx_11_0_arm64.whl | CPython 3.11 | abi3 | macOS 11.0+ ARM64 | Details for rddsketch-0.0.1-cp311-abi3-macosx_11_0_arm64.whl |
| rddsketch-0.0.1-cp311-abi3-macosx_10_12_x86_64.whl | CPython 3.11 | abi3 | macOS 10.12+ x86-64 | Details for rddsketch-0.0.1-cp311-abi3-macosx_10_12_x86_64.whl |
Total release size: 1.3 MB
Release files / rddsketch-0.0.1.tar.gz
| Download URL | rddsketch-0.0.1.tar.gz |
|---|---|
| Size | 16.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d831098cd72ef3aaa81f5ceef0ac0f7cca629c3d6e6cdecbf64f0f94d2ba87a0
|
|
BLAKE2b-256 checksum How to use checksums |
e2daeb3d770178b941a603bf39c53bd46f26bab1db002d5fca1f362249a305e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.
Transparency logRelease files / rddsketch-0.0.1-cp311-abi3-win_amd64.whl
| Download URL | rddsketch-0.0.1-cp311-abi3-win_amd64.whl |
|---|---|
| Size | 150.0 kB |
| Tags | CPython 3.11 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
db8ef2d5a044527ca4587a696f4e594fb9e00f9ec573e3beebed1b9db9e35f9c
|
|
BLAKE2b-256 checksum How to use checksums |
872d65d6efe57a5bcf81a39554ba041a98faea32d281b9ebf43886e5b6d10edd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.
Transparency logRelease files / rddsketch-0.0.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | rddsketch-0.0.1-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 291.0 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
006c07d4efe41926d4cc4844974b7d4b2779d00cdad2ff8a27bbe5977cd8d688
|
|
BLAKE2b-256 checksum How to use checksums |
9558dcea3c029e5e969ca7f35e9d13ec2cf3e9d7bcab58921c14181354ce8725
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.
Transparency logRelease files / rddsketch-0.0.1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | rddsketch-0.0.1-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 287.2 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
0c70c59e1e94ff649fc54f50e90d4d79aae998fbe84563652c47c09f0ff16232
|
|
BLAKE2b-256 checksum How to use checksums |
93e1a10a9ed1b392d089737932c1b06178266f2c4cb42389917ec0c549770570
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.
Transparency logRelease files / rddsketch-0.0.1-cp311-abi3-macosx_11_0_arm64.whl
| Download URL | rddsketch-0.0.1-cp311-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 257.5 kB |
| Tags | CPython 3.11 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
493a360dd1831eef28d9c8bda9f5f46dd3eff16a84ae97383743da8ada059b24
|
|
BLAKE2b-256 checksum How to use checksums |
c47abca267281669c7fc675b2a1050e3f7a7a17ae73d2939a80098ba310de253
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.
Transparency logRelease files / rddsketch-0.0.1-cp311-abi3-macosx_10_12_x86_64.whl
| Download URL | rddsketch-0.0.1-cp311-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 255.7 kB |
| Tags | CPython 3.11 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
7011d69a4a869a8fa17c6444ca2c4f5f32e95911cf4d05650c2c28ae1e4e5905
|
|
BLAKE2b-256 checksum How to use checksums |
e75c21a0e1cb35b32ad3e5dc2a5d6b233ee10ccac6523acfa3f15957e73753cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.
Transparency logSecurity for rddsketch 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 6 files in this release have been uploaded with provenance metadata.
Attestation for rddsketch-0.0.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jul 13, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.