Skip to main content

Small library for in-memory cardinality computing.

Project description

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

  • Exclude autoconf artifacts from sdist.

0.1.0 (initial release)

  • Prototype.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyhll-0.1.1.tar.gz (137.7 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page