Bloomfilter-py is a Python library providing a Bloom filter implementation, notable for its compatibility with Java's Guava library's serialization format. It allows for seamless reading and writing of Bloom filters between Python and Java applications. The current version is 1.1.0, and it has a moderate release cadence, with its latest update in August 2024.
pip install bloomfilter-pyVerified import paths — ran on the pinned version, not inferred.
Demonstrates initializing a Bloom filter, adding elements, checking for membership, and performing Guava-compatible serialization/deserialization.
Tune `expected_insertions` and `err_rate` during initialization to match your application's requirements for memory and accuracy. Keep in mind that a lower `err_rate` or higher `expected_insertions` will increase memory usage.
If element deletion is a requirement, consider using a 'Counting Bloom Filter' (not provided by this library) or rebuilding the filter periodically with only the active elements.
Ensure that any external systems you interact with are also using or compatible with Java Guava's Bloom filter serialization. If not, custom interoperability or a different Bloom filter library may be required.
Monitor the number of insertions. If you anticipate exceeding the initial `expected_insertions`, consider re-initializing a new, larger Bloom filter and migrating existing elements, or design your system to handle the increased false positive rate.
Re-evaluate your expected number of insertions and your acceptable error rate. Initialize the `BloomFilter` with a larger `expected_insertions` or a smaller `err_rate`. Remember that increasing capacity or lowering error rate will consume more memory.
The correct import path is `from bloomfilter import BloomFilter`.
Verify that both the sender and receiver of the Bloom filter data are using or are compatible with Java Guava's Bloom filter serialization format. If not, you will need to use a different Bloom filter library that provides a common serialization format, or implement custom conversion logic.
No dependency data recorded yet.