skillfed

bloom-filter2

Pure Python Bloom Filter module

bloom-filter2 v2.0.0 431.4K downloads/30d#6,717 on PyPI44
Permissive license MIT Abandoned released

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-filter2

uv

uv add bloom-filter2

poetry

poetry add bloom-filter2

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: Python :: 3

Tags

bloom filter pythonprobabilistic set membershiplow storage set datastructurebloom filter implementationmemory-efficient set testingfalse positive probabilitybloom filter backends
data-structuresprobabilistic-algorithms

More Software Development packages