Install & Compatibility
Where this runs
tested against v3.4.1.dev3 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
py 3.12
✕ build_error
✓ 2.25s
py 3.13
✕ build_error
✕ build_error
39MB installed
● package 39MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
HllSketch
✓ from whylogs_sketching.hll_sketch import HllSketch
For HyperLogLog cardinality estimation
FrequentItemsSketch
✓ from whylogs_sketching.frequent_items_sketch import FrequentItemsSketch
For approximate frequent item counting
Histogram
✓ from whylogs_sketching.histogram import Histogram
For approximate histogram generation
FrequentStringsSketch
✓ from whylogs_sketching.datasketches.frequent_strings_sketch import FrequentStringsSketch
Specific frequent strings sketch implementation from datasketches subpackage
This quickstart demonstrates how to initialize an `HllSketch`, add various types of elements to it, and retrieve the approximate count of unique items. It also shows how to merge two sketches to combine their unique counts.
from whylogs_sketching.hll_sketch import HllSketch
# Create an HLL sketch for approximate unique count
sketch = HllSketch()
# Add various values to the sketch
sketch.update("user_a")
sketch.update("user_b")
sketch.update("user_a") # Adding a duplicate
sketch.update("user_c")
sketch.update(123)
sketch.update(456.78)
# Get the approximate number of unique items
cardinality_estimate = sketch.get_estimate()
print(f"Approximate unique items: {cardinality_estimate}")
# You can also merge two sketches
sketch2 = HllSketch()
sketch2.update("user_c") # Another duplicate
sketch2.update("user_d")
sketch.merge(sketch2)
merged_cardinality = sketch.get_estimate()
print(f"Approximate unique items after merge: {merged_cardinality}")
Debug
Known issues
gotchawhylogs-sketching is primarily an internal dependency of the `whylogs` library. While direct usage is possible for low-level operations, most users will interact with its functionalities through `whylogs`'s higher-level APIs, which might offer a more convenient and integrated experience.fixConsider if your use case truly requires direct interaction with sketching primitives or if `whylogs` can provide the necessary functionality more easily.
affects: All versions
gotchaThe latest PyPI version (e.g., 3.4.1.dev3) often reflects a development release. While functional, it might indicate that the library is still under active iteration or that stable releases are primarily tied to `whylogs`'s major versions.fixMonitor the `whylogs` project for stable version announcements or refer to the `whylogs` `pyproject.toml` for the exact `whylogs-sketching` version it depends on.
affects: 3.x.x.devY releases
breakingMajor version changes (e.g., from 0.x to 3.x) have introduced significant API changes, particularly in class constructors, method signatures, and internal data representations.fixAlways consult the official `whylogs-sketching` (or `whylogs`) GitHub repository for specific API changes between major versions when upgrading. Re-test code against new versions.
affects: < 3.0.0 to >= 3.0.0
Upgrade
Version history
3.4.1.dev3latest on PyPI · released Sep 1, 2022
Audit
Dependencies
numpyrequiredNumerical operations for sketches
datasketchesrequiredUnderlying data sketching implementations (e.g., for Frequent Strings Sketch)
typing-extensionsoptionalType hinting support for Python < 3.11