Skip to main content

bouquet-bloom (Python bindings)

Python bindings for bouquet — pluggable Bloom filters with a Rust core.

Not published yet. There is no bouquet-bloom on PyPI at the time of writing, so the install line below will not work until the first release. Build from source in the meantime (see below).

Installed as bouquet-bloom, imported as bouquet:

pip install bouquet-bloom

The bare bouquet name on PyPI belongs to an unrelated placeholder project — pip install bouquet will not get you this library.

import bouquet

f = bouquet.ClassicalFilter.from_false_pos(0.001, 100_000, seed=0xfeedface)
f.insert("hello")           # str is fine — encoded as UTF-8 before hashing
assert "hello" in f
assert b"hello" in f        # bytes work too; str + equivalent bytes hash the same

# Concurrent inserts: GIL is released during the bulk loop.
g = bouquet.AtomicFilter.from_false_pos(0.001, 1_000_000)
items = [str(i) for i in range(1_000_000)]
duplicates = g.insert_many(items)  # parallelizable across Python threads

Building from source

Any Python 3.11+ works; one ABI3 wheel serves all of them.

cd bouquet-py
uv sync                      # locked dev environment + builds the cdylib
uv run --no-sync pytest      # runs the test suite

--no-sync matters after a Rust change: a bare uv run re-syncs the project and can reinstall a cached wheel over the extension you just built. The reliable loop is:

uv run --no-sync maturin develop --release
uv run --no-sync pytest

uv sync invokes maturin transparently because of the build-system = { build-backend = "maturin" } section in pyproject.toml. After a Rust source change, force a rebuild + reinstall:

uv sync --reinstall-package bouquet-bloom

For wheel builds (CI uses this):

uv run maturin build --release
ls ../target/wheels/         # bouquet_bloom-*.whl, one ABI3 wheel per OS/arch

What's exposed

Python class Rust backend Notes
ClassicalFilter bouquet::Classical Single-threaded. The only one with from_num_bits.
AtomicFilter bouquet::Atomic Concurrent; the only one with insert_many, which releases the GIL.
BlockedFilter bouquet::Blocked Cache-line-blocked layout. Trades accuracy for locality — see the root README.

The API is deliberately asymmetric: from_num_bits exists only on ClassicalFilter, and insert_many only on AtomicFilter. Every class has insert, contains, __contains__, clear, estimate_count, is_saturated, num_bits, and num_hashes.

ClassicalFilter and BlockedFilter wrap !Sync Rust types and are pinned to the thread that created them — passing one to another thread raises rather than racing. AtomicFilter is the one built for sharing.

SimdBlocked is intentionally not exposed yet — see ROADMAP.md for the open redesign.

Hashing model

Methods accept bytes / bytearray / memoryview or str. Strings are encoded as UTF-8 before hashing, so f.insert("hello") and f.insert(b"hello") produce identical filter state — pass whichever is more natural at the call site.

For richer Python objects, serialize to bytes yourself before calling. This keeps the hash domain explicit instead of hidden behind __hash__, and avoids the cross-process instability that PYTHONHASHSEED randomization would otherwise introduce.

License

MIT — see LICENSE.

Metadata

Release files for bouquet-bloom 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bouquet-bloom 0.1.1
File Size Uploaded Provenance Actions
bouquet_bloom-0.1.1.tar.gz 77.6 kB With provenance Details for bouquet_bloom-0.1.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for bouquet-bloom 0.1.1
File Actions
bouquet_bloom-0.1.1-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for bouquet_bloom-0.1.1-cp311-abi3-win_amd64.whl
bouquet_bloom-0.1.1-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.11 abi3 Linux glibc 2.17+ x86-64 Details for bouquet_bloom-0.1.1-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
bouquet_bloom-0.1.1-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for bouquet_bloom-0.1.1-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
bouquet_bloom-0.1.1-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for bouquet_bloom-0.1.1-cp311-abi3-macosx_11_0_arm64.whl
bouquet_bloom-0.1.1-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for bouquet_bloom-0.1.1-cp311-abi3-macosx_10_12_x86_64.whl

Total release size: 1.2 MB

Release files / bouquet_bloom-0.1.1.tar.gz

Download URL bouquet_bloom-0.1.1.tar.gz
Size 77.6 kB
Tags Source
SHA-256 checksum
How to use checksums
8a2e0980ebda1c2e73effb013fbc1b90330a72cc5600536bfcea4a5f2281ec30
BLAKE2b-256 checksum
How to use checksums
7a7a8cbb000024168ee3a52ff7b453d3c3b50ec5d231bab59975c98d0243e54b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / bouquet_bloom-0.1.1-cp311-abi3-win_amd64.whl

Download URL bouquet_bloom-0.1.1-cp311-abi3-win_amd64.whl
Size 167.9 kB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
68a1118f6d295179a6d1999dd9ef6be2323bcbb01041367cadb0ebc4424e4371
BLAKE2b-256 checksum
How to use checksums
90ee4698a016898963ac5a790033de16efe91e52771e8796e6f928d37605df6f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / bouquet_bloom-0.1.1-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL bouquet_bloom-0.1.1-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 253.0 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
93494e9b48b553f285efcf61a6286b9395ba7b33c0dd14ec2eaeb8dd614b7bbc
BLAKE2b-256 checksum
How to use checksums
68dcc861916a6b9c57b5aa5fd9203bcb8a46601e6548c281047aa0e0a10b0fd0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / bouquet_bloom-0.1.1-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL bouquet_bloom-0.1.1-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 247.5 kB
Tags CPython 3.11 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
7a715cb834fb7ecaeaa3b4402d3ba1f47a4216ab863dd23d67f987dbc8dbe6e9
BLAKE2b-256 checksum
How to use checksums
192e565fc0cd1d9bf93fdade0c761929da6cc3d608aa7497c91fc8091f8d1d67
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / bouquet_bloom-0.1.1-cp311-abi3-macosx_11_0_arm64.whl

Download URL bouquet_bloom-0.1.1-cp311-abi3-macosx_11_0_arm64.whl
Size 233.5 kB
Tags CPython 3.11 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
669fbb49bf1ff1c12a97bf6ee936b00172208d19d935d525002283ce011cfe6a
BLAKE2b-256 checksum
How to use checksums
496771705881fc14fea5ae9d0c4dc9767d6d21306fadf77d4a2913b3c6631d99
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Release files / bouquet_bloom-0.1.1-cp311-abi3-macosx_10_12_x86_64.whl

Download URL bouquet_bloom-0.1.1-cp311-abi3-macosx_10_12_x86_64.whl
Size 237.2 kB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
a4f06fa335f9cda7ba986c9af74a2c72effc402ca4d194fbd9502eb87c5fe4ee
BLAKE2b-256 checksum
How to use checksums
29e15b31c11a89e496389058afde23d8aef5cb43282ae24ccfb77198c859d3ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

Security for bouquet-bloom 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for bouquet_bloom-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 22, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page