Skip to content

brentp/pybloomfaster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bloomfaster: fast bloomfilter

Author:Brent Pedersen (brentp)
Email:[email protected]
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"

About

fast bloomfilter

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published