Bloom filters with the standard library
Project description
dmfrbloom
Bloom filters with Python standard library.
Examples
Normal bloom filter. Expects 10,000 elements with 99.99% accuracy:
>>> from dmfrbloom.bloomfilter import BloomFilter
>>> bf = BloomFilter(10000, 0.01)
>>> bf.add("test")
>>> bf.lookup("test")
True
>>> bf.lookup("not in filter")
False
>>> bf.save("/home/daniel/filter")
>>> bf2 = BloomFilter(1, 0.1)
>>> bf2.load("/home/daniel/filter")
>>> bf2.lookup("test")
True
>>> bf2.lookup("also not in filter")
False
Time-based filter. 10k elements, 99.99% accuracy, results decay after 60 seconds:
>>> from dmfrbloom.timefilter import TimeFilter
>>> tf = TimeFilter(10000, 0.01, 60)
>>> tf.add("asdf")
>>> tf.lookup("asdf")
True
>>> import time
>>> time.sleep(60)
>>> tf.lookup("asdf")
False
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
dmfrbloom-0.0.7.tar.gz
(7.4 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dmfrbloom-0.0.7.tar.gz.
File metadata
- Download URL: dmfrbloom-0.0.7.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75377d364551cbcef3622da50d8a34ba7d03f9b95fcb3d47ec58f1d4fa95dcc6
|
|
| MD5 |
ca87f02acc0030114f49117da8b81b43
|
|
| BLAKE2b-256 |
179e0d32624aaac28f12449f51336aee438cf5bc3998bc46532e897f13dea57e
|
File details
Details for the file dmfrbloom-0.0.7-py3-none-any.whl.
File metadata
- Download URL: dmfrbloom-0.0.7-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.7.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e754a2406a9af23c82b6ceb3c841a4cf6c845bdd1c2c3dcd0668b7c9ac05e7e9
|
|
| MD5 |
e0b4fe5e17d3c48c99446ba5de06a30d
|
|
| BLAKE2b-256 |
1e4d21ad2f54cccb57e3dd7c60cfb1771d900d95c983f095117bccbb13ef25a5
|