fast bloomfilter
C Python C++
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bloomfaster
examples
src
.gitignore
README.rst
setup.py

README.rst

bloomfaster: fast bloomfilter

Author:Brent Pedersen (brentp)
Email:bpederse@gmail.com
License:MIT

Implementation

Simple cython wrapper to the C-code from Bloom::Faster perl module. It's called 'Elf' because 'ELF' is an early flowering mutant in Arabidopsis. So Bloom Fast => Early Flowering => Elf.

It is tune-able for the number of false positives.

Usage

>>> from bloomfaster import Elf

>>> expected_size = 1000
>>> e = Elf(expected_size, error_rate=1e-10)
>>> e.add("ASDF")
>>> "ASDF" in e
True

>>> e.addmany(("A", "B", "C", "D", "E", "F"))
>>> "B" in e
True

serialization:

>>> e.save("some.elf")
>>> f = Elf.load("some.elf")

>>> "ASDF" in f
True
>>> "AA" in f
False

Tests

$ python setup.py test

or with nose:

$ nosetests --with-doctest --doctest-extension="pyx" --doctest-extension="rst"