bloom-filter2
Pure Python Bloom Filter module
What it is and what it does
bloom-filter2 provides a Bloom filter—a space-efficient probabilistic data structure that answers "have I seen this element?" with a tunable false positive rate. You specify the maximum number of elements and acceptable error rate, and the module calculates the required bit array size and hash functions automatically. It supports three storage backends: in-memory arrays, memory-mapped files, and disk-seek operations, letting you trade speed for storage footprint.
The package is a pure Python implementation with no external dependencies, making it portable across CPython 3.x, PyPy, and Jython. It is useful when you need fast approximate membership testing on large datasets where occasional false positives are acceptable but false negatives are not—typical in caching, duplicate detection, and network routing.
Use it for:
- Deduplicate incoming data streams without storing the full dataset in memory
- Cache-layer membership testing to avoid expensive lookups for items you've never seen
- Network packet filtering or URL blacklist checking with bounded memory
- Approximate set operations in data pipelines where false positives are tolerable
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A pure Python implementation of a Bloom filter—a probabilistic data structure for testing set membership with configurable space-accuracy tradeoff, supporting mmap, in-memory, and disk-seek backends.
Yes, if you need a simple, dependency-free Bloom filter and can tolerate the lack of active maintenance. The implementation is marked stable and has no known vulnerabilities. However, verify compatibility with your Python version and consider whether an actively maintained alternative is available for production systems where you need ongoing support or bug fixes.
Install
bloom-filter2 on PyPI
pip
pip install bloom-filter2uv
uv add bloom-filter2poetry
poetry add bloom-filter2Installing bloom-filter2
Before you install
Low install friction with no runtime dependencies. However, the package is abandoned—last release was 2021-05-05 and the repository shows no commits since 2021-07-06. It is marked Production/Stable but receives no active maintenance.
License in practice
MIT license is permissive, allowing commercial and private use with minimal restrictions—suitable for most projects without licensing concerns.
Quickstart
pip install bloom-filter2
from bloom_filter2 import BloomFilter
bloom = BloomFilter(max_elements=10000, error_rate=0.1)
bloom.add("test-key")
assert "test-key" in bloom
Verify before relying
- Whether the package works reliably on modern Python versions beyond the last release date (2021-05-05)
- Performance characteristics and memory footprint compared to active alternatives
- Whether mmap and disk-seek backends are production-ready or have known limitations
Package facts
| License | MIT (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,927 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 431,376/month — #6,717 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: bloom_filter2-2.0.0-py3-none-any.whl
Keywords: probabilistic, set, datastructure
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
eth-bloomImplements Ethereum's bloom filter algorithm…
permissive · top 15,000 on PyPI
preshedPreshed provides high-performance Cython hash…
permissive · top 1,000 on PyPI
pybloom-liveImplements Bloom filters—space-efficient…
permissive · top 15,000 on PyPI
bloomfilter-pyImplements Bloom filters in Python with…
permissive · top 15,000 on PyPI
rbloomImplements a Bloom filter data structure in…
unclear · top 15,000 on PyPI
mmhash3mmhash3 is a Python wrapper for MurmurHash3,…
permissive · top 15,000 on PyPI
datasketchProvides probabilistic data structures…
permissive · top 5,000 on PyPI
floretfloret trains compact word embeddings using…
permissive · top 15,000 on PyPI
mmh3mmh3 is a Python binding to MurmurHash3, a fast…
permissive · top 1,000 on PyPI