A Bloom filter (bloomfilter) for Python 3 built on mmap
Project description
pybloomfiltermmap3
pybloomfiltermmap3
is a Python 3
compatible fork of pybloomfiltermmap
by @axiak.
The goal of pybloomfiltermmap3
is simple: to provide a fast, simple, scalable, correct library for Bloom Filters in Python.
Quickstart
After you install, the interface to use is a cross between a file interface and a ste interface. As an example:
>>> import pybloomfilter
>>> fruit = pybloomfilter.BloomFilter(100000, 0.1, '/tmp/words.bloom')
>>> fruit.update(('apple', 'pear', 'orange', 'apple'))
>>> len(fruit)
3
>>> 'mike' in fruit
False
>>> 'apple' in fruit
True
To create an in-memory filter, ditch the file location.
>>> cakes = pybloomfilter.BloomFilter(10000, 0.1)
Caveates: It is currently not possible to persist this filter later.
Docs
Follow the official docs for pybloomfiltermmap
. http://axiak.github.io/pybloomfiltermmap/
Install
Please have Cython
installed. Please note that this version is specifically meant for Python 3. In case you need Python 2, please see https://github.com/axiak/pybloomfiltermmap.
To install:
$ pip install cython
$ pip install pybloomfiltermmap3
and you should be set.
License
See the LICENSE file. It's under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pybloomfiltermmap3-0.4.17.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a3ca32ae898ca53cf6c86550587477b8db08b3820d30be6aa73acf742930c8b |
|
MD5 | d264d2d58e6c7b4d7aec06644b3f9455 |
|
BLAKE2b-256 | b8c18b1c7b0db349e9a8d39cdc978e843c54302d6678adf096a32daa2a20987f |
Hashes for pybloomfiltermmap3-0.4.17-cp36-cp36m-macosx_10_13_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f342c327eb4b235b5bccfac65eabc960967c2b07cee0ff943e60dadd2da836fd |
|
MD5 | 64e970a6ab725c575cfe966919c23ccf |
|
BLAKE2b-256 | 0eebaa1eb9f85b60ed20614e9979e4862ac4aa572f6ffe00f1806b2f2528a2c5 |