|
@@ -13,7 +13,7 @@ from setuptools import setup
|
|
|
|
|
|
setup(
|
|
|
name="bloom_filter",
|
|
|
- version="1.02",
|
|
|
+ version="1.10",
|
|
|
packages=find_packages('src'),
|
|
|
package_dir={'': 'src'},
|
|
|
py_modules=[splitext(basename(path))[0] for path in glob('src/*.py')],
|
|
@@ -32,6 +32,29 @@ 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
|
|
|
+
|
|
|
""",
|
|
|
license="MIT",
|
|
|
keywords="probabilistic set datastructure",
|