Skip to main content

Cuckoo Filter implementation using Python

Project description

Cuckoofilter is an implementation of Cuckoo Filter using Python, which is thread-safe.
Besides, the package can both be used in python2.x and python3.x.

Cuckoo Filter
Cuckoo filter first appeared in the paper
`Cuckoo Filter: Practically Better Than Bloom <>`_
by Bin Fan,David G. Andersen, Michael Kaminsky and Michael D. Mitzenmacher, which is used to
replace Bloom filters for approximate set membership tests. Cuckoo filters support
adding and removing items dynamically while achieving even higher performance than
Bloom filters. For applications that store many items and target moderately low
false positive rates, cuckoo filters have lower space overhead than space-optimized
Bloom filters.

To know more details of Cuckoo Filter, please read the paper.

Install cuckoofilter:

.. code-block::

$ pip install cuckoopy

.. code-block::

$ pip3 install cuckoopy

.. code-block:: python

>>> import cuckoofilter
>>> cf = cuckoofilter.CuckooFilter(capacity=100, fingerprint_size=1)

>>> cf.insert('test')

>>> cf.contains('test')

>>> cf.delete('test')

To test the package and generate a test coverage report, you should run
.. code-block::

$ pip install pytest coverage pytest-cov
$ pytest -v -cov=cuckoofilter --cov-report html

.. code-block::

$ pip3 install pytest coverage pytest-cov
$ python3 -m pytest .

`GPL-3.0 License <>`_

Project details

Release history Release notifications

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
cuckoofilter- (6.7 kB) Copy SHA256 hash SHA256 Wheel py2.py3
cuckoofilter- (4.0 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page