python-bloomfilter icon indicating copy to clipboard operation
python-bloomfilter copied to clipboard

Load bloom filter from bytes (instead of loading from file)

Open jonsnowseven opened this issue 5 years ago • 2 comments

Hello.

Is there a way to load a Bloom Filter from bytes instead of loading from a file? The advantage is that we do not need to download a file to load a Bloom Filter.

Thank you in advance.

jonsnowseven avatar Dec 04 '20 11:12 jonsnowseven

I ended up doing a workaround:

import io
import pybloom_live

with open(<bloomfilter_file>, "rb") as f:
    bytes_io = io.BytesIO(f.read())

pybloom_live.BloomFilter.fromfile(bytes_io)

jonsnowseven avatar Mar 22 '21 13:03 jonsnowseven

Maybe you can try fastbloom. A super fast bloom filter | counting bloom filter implemented by Rust for Python!

yankun1992 avatar Aug 23 '22 16:08 yankun1992