Skip to content

Commit 6e1eda0

Browse files
authored
Merge pull request jaybaird#8 from joseph-fox/hotfix/readme
Change `README` to .md format
2 parents 4d41391 + eeb7314 commit 6e1eda0

File tree

3 files changed

+311
-84
lines changed

3 files changed

+311
-84
lines changed

.gitignore

Lines changed: 226 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,228 @@
1-
*.egg
1+
env
2+
*.pyc
3+
*.sqlite3
4+
5+
### Django ###
6+
*.log
7+
*.pot
28
*.pyc
3-
*.egg-info
4-
build
5-
dist
9+
__pycache__/
10+
local_settings.py
11+
db.sqlite3
12+
media
13+
14+
### macOS ###
15+
*.DS_Store
16+
.AppleDouble
17+
.LSOverride
18+
19+
# Icon must end with two \r
20+
Icon
21+
22+
# Thumbnails
23+
._*
24+
25+
# Files that might appear in the root of a volume
26+
.DocumentRevisions-V100
27+
.fseventsd
28+
.Spotlight-V100
29+
.TemporaryItems
30+
.Trashes
31+
.VolumeIcon.icns
32+
.com.apple.timemachine.donotpresent
33+
34+
# Directories potentially created on remote AFP share
35+
.AppleDB
36+
.AppleDesktop
37+
Network Trash Folder
38+
Temporary Items
39+
.apdisk
40+
41+
### PyCharm ###
42+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
43+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
44+
.idea/*
45+
46+
# CMake
47+
cmake-build-debug/
48+
49+
# Mongo Explorer plugin:
50+
.idea/**/mongoSettings.xml
51+
52+
## File-based project format:
53+
*.iws
54+
55+
## Plugin-specific files:
56+
57+
# IntelliJ
58+
/out/
59+
60+
# mpeltonen/sbt-idea plugin
61+
.idea_modules/
62+
63+
# JIRA plugin
64+
atlassian-ide-plugin.xml
65+
66+
# Cursive Clojure plugin
67+
.idea/replstate.xml
68+
69+
# Crashlytics plugin (for Android Studio and IntelliJ)
70+
com_crashlytics_export_strings.xml
71+
crashlytics.properties
72+
crashlytics-build.properties
73+
fabric.properties
74+
75+
### PyCharm Patch ###
76+
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
77+
78+
# *.iml
79+
# modules.xml
80+
# .idea/misc.xml
81+
# *.ipr
82+
83+
# Sonarlint plugin
84+
.idea/sonarlint
85+
86+
### Python ###
87+
# Byte-compiled / optimized / DLL files
88+
*.py[cod]
89+
*$py.class
90+
91+
# C extensions
92+
*.so
93+
94+
# Distribution / packaging
95+
.Python
96+
env/
97+
build/
98+
develop-eggs/
99+
dist/
100+
downloads/
101+
eggs/
102+
.eggs/
103+
lib/
104+
lib64/
105+
parts/
106+
sdist/
107+
var/
108+
wheels/
109+
*.egg-info/
110+
.installed.cfg
111+
*.egg
112+
113+
# PyInstaller
114+
# Usually these files are written by a python script from a template
115+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
116+
*.manifest
117+
*.spec
118+
119+
# Installer logs
120+
pip-log.txt
121+
pip-delete-this-directory.txt
122+
123+
# Unit test / coverage reports
124+
htmlcov/
125+
.tox/
126+
.coverage
127+
.coverage.*
128+
.cache
129+
nosetests.xml
130+
coverage.xml
131+
*,cover
132+
.hypothesis/
133+
134+
# Translations
135+
*.mo
136+
137+
# Django stuff:
138+
139+
# Flask stuff:
140+
instance/
141+
.webassets-cache
142+
143+
# Scrapy stuff:
144+
.scrapy
145+
146+
# Sphinx documentation
147+
docs/_build/
148+
149+
# PyBuilder
150+
target/
151+
152+
# Jupyter Notebook
153+
.ipynb_checkpoints
154+
155+
# pyenv
156+
.python-version
157+
158+
# celery beat schedule file
159+
celerybeat-schedule
160+
161+
# SageMath parsed files
162+
*.sage.py
163+
164+
# dotenv
165+
.env
166+
167+
# virtualenv
6168
.venv
7-
.tox
169+
venv/
170+
ENV/
171+
172+
# Spyder project settings
173+
.spyderproject
174+
.spyproject
175+
176+
# Rope project settings
177+
.ropeproject
178+
179+
# mkdocs documentation
180+
/site
181+
182+
### SublimeText ###
183+
# cache files for sublime text
184+
*.tmlanguage.cache
185+
*.tmPreferences.cache
186+
*.stTheme.cache
187+
188+
# workspace files are user-specific
189+
*.sublime-workspace
190+
191+
# project files should be checked into the repository, unless a significant
192+
# proportion of contributors will probably not be using SublimeText
193+
# *.sublime-project
194+
195+
# sftp configuration file
196+
sftp-config.json
197+
198+
# Package control specific files
199+
Package Control.last-run
200+
Package Control.ca-list
201+
Package Control.ca-bundle
202+
Package Control.system-ca-bundle
203+
Package Control.cache/
204+
Package Control.ca-certs/
205+
Package Control.merged-ca-bundle
206+
Package Control.user-ca-bundle
207+
oscrypto-ca-bundle.crt
208+
bh_unicode_properties.cache
209+
210+
# Sublime-github package stores a github token in this file
211+
# https://packagecontrol.io/packages/sublime-github
212+
GitHub.sublime-settings
213+
214+
### Vim ###
215+
# swap
216+
[._]*.s[a-v][a-z]
217+
[._]*.sw[a-p]
218+
[._]s[a-v][a-z]
219+
[._]sw[a-p]
220+
# session
221+
Session.vim
222+
# temporary
223+
.netrwhist
224+
*~
225+
# auto-generated tag files
226+
tags
227+
228+
# End of https://www.gitignore.io/api/vim,macos,django,python,pycharm,sublimetext

README.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
[![Build Status](https://travis-ci.org/joseph-fox/python-bloomfilter.svg?branch=master)](https://travis-ci.org/joseph-fox/python-bloomfilter)
2+
3+
#Python Bloom Filter
4+
5+
6+
This Bloom Filter has its tightening ratio updated to 0.9, and this ration
7+
is consistently used throughout the `pybloom` module..
8+
Choosing r around 0.8 - 0.9 will result in better average space usage for wide
9+
range of growth, therefore the default value of model is set to
10+
LARGE_SET_GROWTH. This is a module that includes a Bloom Filter data structure
11+
along with an implementation of Scalable Bloom Filters as discussed in:
12+
13+
```
14+
P. Almeida, C.Baquero, N. Preguiça, D. Hutchison, Scalable Bloom Filters, (GLOBECOM 2007), IEEE, 2007.
15+
```
16+
Bloom filters are great if you understand what amount of bits you need to set
17+
aside early to store your entire set. Scalable Bloom Filters allow your bloom
18+
filter bits to grow as a function of false positive probability and size.
19+
20+
A filter is "full" when at capacity: `M * ((ln 2 ^ 2) / abs(ln p))`, where M
21+
is the number of bits and p is the false positive probability. When capacity
22+
is reached a new filter is then created exponentially larger than the last
23+
with a tighter probability of false positives and a larger number of hash
24+
functions.
25+
26+
```python
27+
>>> import pybloom_live
28+
>>> f = pybloom_live.BloomFilter(capacity=1000, error_rate=0.001)
29+
>>> [f.add(x) for x in range(10)]
30+
[False, False, False, False, False, False, False, False, False, False]
31+
>>> all([(x in f) for x in range(10)])
32+
True
33+
>>> 10 in f
34+
False
35+
>>> 5 in f
36+
True
37+
>>> f = pybloom_live.BloomFilter(capacity=1000, error_rate=0.001)
38+
>>> for i in xrange(0, f.capacity):
39+
... _ = f.add(i)
40+
>>> (1.0 - (len(f) / float(f.capacity))) <= f.error_rate + 2e-18
41+
True
42+
43+
>>> sbf = pybloom_live.ScalableBloomFilter(mode=pybloom_live.ScalableBloomFilter.SMALL_SET_GROWTH)
44+
>>> count = 10000
45+
>>> for i in range(0, count):
46+
_ = sbf.add(i)
47+
48+
>>> (1.0 - (len(sbf) / float(count))) <= sbf.error_rate + 2e-18
49+
True
50+
# len(sbf) may not equal the entire input length. 0.01% error is well
51+
# below the default 0.1% error threshold. As the capacity goes up, the
52+
# error will approach 0.1%.
53+
```
54+
#Development
55+
We follow this [git branching model](http://nvie.com/posts/a-successful-git-branching-model/),
56+
please have a look at it.
57+
58+
59+
#Installation instructions
60+
If you are installing from an internet-connected computer (or virtual
61+
install), you can use the pip python package manager to download and install
62+
this package. Simply type `pip install pybloom-live` from a DOS command
63+
prompt (`cmd.exe`) or a linux shell (e.g. `bash` or `dash` on MacOS X as well
64+
as linux OSes including debian, slackware, redhat, enoch and arch).
65+
66+
If using Windows and you are installing onto an air-gapped computer or want
67+
the most up-to-date version from this repository, you can do the following:
68+
69+
1. Download the zip file by clicking on the green "Clone or Download"
70+
link followed by "Download Zip."
71+
72+
2. Extract all the contents of the the zip folder.
73+
74+
3. Open command prompt (``cmd.exe``) to the extracted folder.
75+
a. Find the extracted folder in Windows Explorer.
76+
b. From the parent folder level Shift+RightClick on the folder.
77+
c. Select "Open command window here".
78+
79+
4. Type `pip install .`.
80+
81+
Similar steps are possible under linux and MacOS X.
82+
83+
#Installation verification
84+
Type `pip show pybloom-live` from a command prompt. Version should be
85+
2.2.0 as of 2016-12-11.

0 commit comments

Comments
 (0)