Skip to main content

pyhll - simple library for cardinality detection using HyperLogLog

CI status: cistatus

pyhll can be used to compute cardinality, i.e. the unique number of elements in some set using HyperLogLog. This library is a thin python wrapper around HyperLogLog implementation in https://raw.github.com/armon/hlld

Installing

pyhll can be installed via pypi:

pip install pyhll

Building

Get the source:

git clone https://github.com/blackwithwhite666/pyhll.git

Compile extension:

python setup.py build_ext --inplace

Usage

from pyhll import Cardinality
c = Cardinality()
c.add(b'foo')
assert 1 == len(c)
c.add(b'bar')
assert 2 == len(c)
c.add(b'bar')
assert 2 == len(c)
c.update([b'bar', b'buzz'])
assert 3 == len(c)

Running the test suite

Use Tox to run the test suite:

tox

References

Here are some related works which we make use of:

Changelog

0.2.4

  • Add dump and load support;

0.2.3

  • Add support for fluent iface;

0.2.1-0.2.2

  • Fix build on CentOS;

0.2.0

  • Add ability to union sets;

  • Add serialization support;

0.1.1

  • Exclude autoconf artifacts from sdist.

0.1.0 (initial release)

  • Prototype.

Metadata

Release files for pyhll 0.2.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyhll 0.2.4
File Size Uploaded Provenance
pyhll-0.2.4.tar.gz 166.5 kB Without provenance Details

Release files / pyhll-0.2.4.tar.gz

Download URL pyhll-0.2.4.tar.gz
Size 166.5 kB
Tags Source
SHA-256 checksum
How to use checksums
70b3788e40840102dc4fa0ab450ac4e9214b5efc15cb8b93a21453431668e157
BLAKE2b-256 checksum
How to use checksums
ac9ec658e22f5cef1a8ab2dd7578f9cf94d455178f43c7d44c47871b8c338520
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for pyhll 0.2.4

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page