Note: This project has gone unmaintained for a while, please use the more up-to-date project at: - https://github.com/remram44/python-bloom-filter - https://pypi.org/project/bloom-filter2/
A pure python bloom filter (low storage requirement, probabilistic set datastructure) is provided. It is known to work on CPython 2.x, CPython 3.x, Pypy and Jython.
Includes mmap, in-memory and disk-seek backends.
The user specifies the desired maximum number of elements and the desired maximum false positive probability, and the module calculates the rest.
Usage:
from bloom_filter import BloomFilter
# instantiate BloomFilter with custom settings,
# max_elements is how many elements you expect the filter to hold.
# error_rate defines accuracy; You can use defaults with
# `BloomFilter()` without any arguments. Following example
# is same as defaults:
bloom = BloomFilter(max_elements=10000, error_rate=0.1)
# Test whether the bloom-filter has seen a key:
assert "test-key" in bloom is False
# Mark the key as seen
bloom.add("test-key")
# Now check again
assert "test-key" in bloom is True
Release files for bloom-filter 1.3.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bloom_filter-1.3.3.tar.gz | 7.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bloom_filter-1.3.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.3 kB
Release files / bloom_filter-1.3.3.tar.gz
| Download URL | bloom_filter-1.3.3.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8c230b748565c0b7493923542be9658d9a247d3205352d4f65d428a4bf462ec8
|
|
BLAKE2b-256 checksum How to use checksums |
b24243d11c75b769cb4e7ca1fd756c4ac98db5144ce2e00711a25dcbe1412648
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.7.10
|
Release files / bloom_filter-1.3.3-py3-none-any.whl
| Download URL | bloom_filter-1.3.3-py3-none-any.whl |
|---|---|
| Size | 8.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
937f3e6843fd137aa8a7723c556b970e9bc8a55e2100d86d46262469ae128dd1
|
|
BLAKE2b-256 checksum How to use checksums |
b3bf6f08439d017abdbf1594f5acfdf39d0c0f2d9a16eefdb69f334a5d5e7e3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.7.10
|