Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Commit d83fde1

Browse files
committed
Update repo after fork
1 parent 2bbe01a commit d83fde1

10 files changed

Lines changed: 35 additions & 55 deletions

File tree

.travis.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

README.rst

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,15 @@
1-
pybloom
1+
pybloom2
22
=======
33

4-
.. image:: https://travis-ci.org/jaybaird/python-bloomfilter.svg?branch=master
5-
:target: https://travis-ci.org/jaybaird/python-bloomfilter
64

7-
``pybloom`` is a module that includes a Bloom Filter data structure along with
8-
an implmentation of Scalable Bloom Filters as discussed in:
5+
``pybloom2`` is a fork of https://github.com/jaybaird/python-bloomfilter.
6+
It includes a Bloom Filter data structure along with
7+
an implementation of Scalable Bloom Filter[1].
98

10-
P. Almeida, C.Baquero, N. Preguiça, D. Hutchison, Scalable Bloom Filters,
11-
(GLOBECOM 2007), IEEE, 2007.
12-
13-
Bloom filters are great if you understand what amount of bits you need to set
14-
aside early to store your entire set. Scalable Bloom Filters allow your bloom
15-
filter bits to grow as a function of false positive probability and size.
16-
17-
A filter is "full" when at capacity: M * ((ln 2 ^ 2) / abs(ln p)), where M
18-
is the number of bits and p is the false positive probability. When capacity
19-
is reached a new filter is then created exponentially larger than the last
20-
with a tighter probability of false positives and a larger number of hash
21-
functions.
229

2310
.. code-block:: python
2411
25-
>>> from pybloom import BloomFilter
12+
>>> from pybloom2 import BloomFilter
2613
>>> f = BloomFilter(capacity=1000, error_rate=0.001)
2714
>>> [f.add(x) for x in range(10)]
2815
[False, False, False, False, False, False, False, False, False, False]
@@ -38,7 +25,7 @@ functions.
3825
>>> (1.0 - (len(f) / float(f.capacity))) <= f.error_rate + 2e-18
3926
True
4027
41-
>>> from pybloom import ScalableBloomFilter
28+
>>> from pybloom2 import ScalableBloomFilter
4229
>>> sbf = ScalableBloomFilter(mode=ScalableBloomFilter.SMALL_SET_GROWTH)
4330
>>> count = 10000
4431
>>> for i in xrange(0, count):
@@ -50,3 +37,9 @@ functions.
5037
# len(sbf) may not equal the entire input length. 0.01% error is well
5138
# below the default 0.1% error threshold. As the capacity goes up, the
5239
# error will approach 0.1%.
40+
41+
42+
..
43+
references
44+
==========
45+
[1] P. Almeida, C.Baquero, N. Preguiça, D. Hutchison, Scalable Bloom Filters, (GLOBECOM 2007), IEEE, 2007. http://www.sciencedirect.com/science/article/pii/S0020019006003127
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
#
33
"""Test performance of BloomFilter at a set capacity and error rate."""
44
import sys
5-
from pybloom import BloomFilter
5+
from pybloom2 import BloomFilter
66
import bitarray, math, time
7-
from utils import range_fn
7+
from pybloom2.utils import range_fn
88

99

1010
def main(capacity=100000, request_error_rate=0.1):
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
66
Requires the bitarray library: http://pypi.python.org/pypi/bitarray/
77
8-
>>> from pybloom import BloomFilter
8+
>>> from pybloom2 import BloomFilter
99
>>> f = BloomFilter(capacity=10000, error_rate=0.001)
1010
>>> for i in range_fn(0, f.capacity):
1111
... _ = f.add(i)
@@ -19,7 +19,7 @@
1919
>>> (1.0 - (len(f) / float(f.capacity))) <= f.error_rate + 2e-18
2020
True
2121
22-
>>> from pybloom import ScalableBloomFilter
22+
>>> from pybloom2 import ScalableBloomFilter
2323
>>> sbf = ScalableBloomFilter(mode=ScalableBloomFilter.SMALL_SET_GROWTH)
2424
>>> count = 10000
2525
>>> for i in range_fn(0, count):
@@ -36,13 +36,13 @@
3636
from __future__ import absolute_import
3737
import math
3838
import hashlib
39-
from pybloom.utils import range_fn, is_string_io, running_python_3
39+
from pybloom2.utils import range_fn, is_string_io, running_python_3
4040
from struct import unpack, pack, calcsize
4141

4242
try:
4343
import bitarray
4444
except ImportError:
45-
raise ImportError('pybloom requires bitarray >= 0.3.4')
45+
raise ImportError('pybloom2 requires bitarray >= 0.3.4')
4646

4747
__version__ = '2.0'
4848
__author__ = "Jay Baird <jay.baird@me.com>, Bob Ippolito <bob@redivi.com>,\

pybloom/tests.py renamed to pybloom2/tests.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import absolute_import
2-
from pybloom.pybloom import BloomFilter, ScalableBloomFilter
3-
from pybloom.utils import running_python_3, range_fn
2+
from pybloom2.pybloom import BloomFilter, ScalableBloomFilter
3+
from pybloom2.utils import running_python_3, range_fn
44

55
try:
66
from StringIO import StringIO
@@ -17,7 +17,7 @@
1717
def additional_tests():
1818
proj_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
1919
readme_fn = os.path.join(proj_dir, 'README.txt')
20-
suite = TestSuite([doctest.DocTestSuite('pybloom.pybloom')])
20+
suite = TestSuite([doctest.DocTestSuite('pybloom2.pybloom')])
2121
if os.path.exists(readme_fn):
2222
suite.addTest(doctest.DocFileSuite(readme_fn, module_relative=False))
2323
return suite
File renamed without changes.

requirements.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

setup.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/usr/bin/env python
22
from setuptools import setup
33

4-
VERSION = '2.0.0'
5-
DESCRIPTION = "PyBloom: A Probabilistic data structure"
4+
VERSION = "2.0.0"
5+
DESCRIPTION = "PyBloom2: A Probabilistic data structure"
66
LONG_DESCRIPTION = """
7-
pybloom is a Python implementation of the bloom filter probabilistic data
7+
pybloom2 is a Python implementation of the bloom filter probabilistic data
88
structure. The module also provides a Scalable Bloom Filter that allows a
99
bloom filter to grow without knowing the original set size.
1010
"""
@@ -22,20 +22,19 @@
2222
""".splitlines()))
2323

2424
setup(
25-
name="pybloom",
25+
name="pybloom2",
2626
version=VERSION,
2727
description=DESCRIPTION,
2828
long_description=LONG_DESCRIPTION,
2929
classifiers=CLASSIFIERS,
30-
keywords=('data structures', 'bloom filter', 'bloom', 'filter',
31-
'probabilistic', 'set'),
32-
author="Jay Baird",
33-
author_email="jay.baird@me.com",
34-
url="http://github.com/jaybaird/python-bloomfilter/",
30+
keywords=("data structures", "bloom filter", "bloom", "filter",
31+
"probabilistic", "set"),
32+
author="Growbots",
33+
url="https://github.com/growbots/python-bloomfilter",
3534
license="MIT License",
36-
platforms=['any'],
37-
test_suite="pybloom.tests",
35+
platforms=["any"],
36+
test_suite="pybloom2.tests",
3837
zip_safe=True,
39-
install_requires=['bitarray>=0.3.4'],
40-
packages=['pybloom']
38+
install_requires=["bitarray>=0.3.4"],
39+
packages=["pybloom2"]
4140
)

tox.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py26,py27,py34
2+
envlist = py26,py27,py34,py35,py36
33
[testenv]
44
deps=pytest
5-
commands=py.test pybloom/tests.py
5+
commands=py.test pybloom2/tests.py

0 commit comments

Comments
 (0)