rbloom
Highly optimized Bloom filter that mimics the Python set API, written in Rust
What it is and what it does
rBloom is a Bloom filter library written in Rust and exposed to Python, designed to provide fast probabilistic membership testing with a set-like API. It takes two parameters—expected item count and desired false positive rate—and creates a compact bit array that can quickly answer "is this item in the set?" with a tunable error rate. Unlike exact set membership (which requires storing all items), a Bloom filter trades a small, configurable false positive rate for dramatic space savings and speed.
The library mimics Python's built-in set type where possible, supporting operations like add, contains, union, intersection, and subset comparisons. It works with any hashable Python object (strings, numbers, tuples, etc.) and includes methods to serialize filters to bytes or disk for persistence. The implementation is compiled against a stable ABI for portability across Python versions, and prebuilt wheels cover most common architectures.
Use it for:
- Check membership in large datasets (IP blocklists, URL filters, spam detection) where exact storage is impractical
- Deduplicate items in streaming data pipelines where occasional false positives are acceptable
- Cache negative results: quickly rule out items not in a database before expensive lookups
- Combine multiple filters using set operations (union, intersection) to aggregate or refine membership rules
- Persist membership state across application restarts by serializing filters to disk or bytes
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Implements a Bloom filter data structure in Rust with a Python API that mimics the built-in set type, enabling fast probabilistic membership testing for any hashable object.
Yes, if you need fast probabilistic membership testing and can tolerate a small, tunable false positive rate. The library is actively maintained, has no dependencies, and offers significantly better performance than pure-Python alternatives. The main caveat is the unclear license—verify it meets your use case before committing to production. Install friction is moderate but manageable for common platforms.
Install
rbloom on PyPI
pip
pip install rbloomuv
uv add rbloompoetry
poetry add rbloomInstalling rbloom
Before you install
Medium friction due to compiled wheels; prebuilt binaries available for common platforms (x86_64, ARM, PowerPC, s390x on Linux; x86_64 and ARM on macOS; x86 and x64 on Windows), but uncommon platforms require Rust toolchain. No runtime dependencies. Last release 339 days ago; repository active and well-maintained.
License in practice
License status is unclear—no SPDX identifier or raw license text provided in package metadata. Before production use, verify the actual license by checking the repository directly.
Quickstart
pip install rbloom
from rbloom import Bloom
bf = Bloom(200, 0.01) # 200 items max, 1% false positive rate
bf.add("hello")
print("hello" in bf) # True
print("world" in bf) # False
Requires Python 3.7 or later. On uncommon platforms without prebuilt wheels, installation requires the Rust toolchain.
Verify before relying
- Whether the unclear license permits commercial or proprietary use without restriction
- Performance characteristics on very large filters (millions of items) in production workloads
- Memory overhead compared to pure-Python alternatives or C-based implementations
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (>=3.7) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | aging — 339 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 386,080/month — #7,053 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: rbloom-1.5.4-cp37-abi3-macosx_10_12_x86_64.whl; rbloom-1.5.4-cp37-abi3-macosx_11_0_arm64.whl; rbloom-1.5.4-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; rbloom-1.5.4-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl; rbloom-1.5.4-cp37-abi3-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl; rbloom-1.5.4-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl; rbloom-1.5.4-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; rbloom-1.5.4-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl; rbloom-1.5.4-cp37-abi3-win32.whl; rbloom-1.5.4-cp37-abi3-win_amd64.whl
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
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
bloom-filter2A pure Python implementation of a Bloom…
permissive · top 15,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
ignore-pythonProvides fast recursive directory traversal…
unclear · top 15,000 on PyPI
immutablesProvides an immutable mapping type backed by a…
permissive · top 5,000 on PyPI
blake3Python bindings for the BLAKE3 cryptographic…
permissive · top 5,000 on PyPI
floretfloret trains compact word embeddings using…
permissive · top 15,000 on PyPI