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.0

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.0
File Size Uploaded Provenance Actions
bouquet_bloom-0.1.0.tar.gz 77.5 kB With provenance Details for bouquet_bloom-0.1.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for bouquet-bloom 0.1.0
File Actions
bouquet_bloom-0.1.0-cp311-abi3-win_amd64.whl CPython 3.11 abi3 Windows x86-64 Details for bouquet_bloom-0.1.0-cp311-abi3-win_amd64.whl
bouquet_bloom-0.1.0-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.0-cp311-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
bouquet_bloom-0.1.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.11 abi3 Linux glibc 2.17+ ARM64 Details for bouquet_bloom-0.1.0-cp311-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
bouquet_bloom-0.1.0-cp311-abi3-macosx_11_0_arm64.whl CPython 3.11 abi3 macOS 11.0+ ARM64 Details for bouquet_bloom-0.1.0-cp311-abi3-macosx_11_0_arm64.whl
bouquet_bloom-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl CPython 3.11 abi3 macOS 10.12+ x86-64 Details for bouquet_bloom-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl

Total release size: 1.2 MB

Release files / bouquet_bloom-0.1.0.tar.gz

Download URL bouquet_bloom-0.1.0.tar.gz
Size 77.5 kB
Tags Source
SHA-256 checksum
How to use checksums
efae9e88bf9c26ddaaa9516b6d97520659e887e5baffaf6fcdbb09d61b297947
BLAKE2b-256 checksum
How to use checksums
1306ba351906602865ad007b74e6834e302c58269dc5ac4721f20a71c6c263c6
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 21, 2026.

Transparency log

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

Download URL bouquet_bloom-0.1.0-cp311-abi3-win_amd64.whl
Size 167.9 kB
Tags CPython 3.11 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
ad0365f4719fca18aaeec5a7503fde14b669261121b3adf1a467f4efb31628db
BLAKE2b-256 checksum
How to use checksums
b7806dea905884fad395be9c5d42b9f810f3c3a87eb4b4bcc0e5737d986a7af0
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 21, 2026.

Transparency log

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

Download URL bouquet_bloom-0.1.0-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
2caa210da222e372826bfd8f18c2c5607750de6fdc5f974a13ddace4c3f17484
BLAKE2b-256 checksum
How to use checksums
dbcff24afa43c0cc0f5bbbbc648056783915af6d0785e9cf20cb73aeeb822a52
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 21, 2026.

Transparency log

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

Download URL bouquet_bloom-0.1.0-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
2ca9bf08dcee901de17867f701809b11e7674a8e8d59bec4fc478ba9719a8493
BLAKE2b-256 checksum
How to use checksums
f2e98f287d9b0fb6fbf3f77ca5cf10180a087aedae50cc0fd11e6164a125e14a
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 21, 2026.

Transparency log

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

Download URL bouquet_bloom-0.1.0-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
a75e9492f43b771b73dceec16cf67ca14a8aed361e056e26e92ef351e861a416
BLAKE2b-256 checksum
How to use checksums
c525db6d116b5166e76af6567da8b8fc7c42c82b8ff7bf75195c4db33a727811
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 21, 2026.

Transparency log

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

Download URL bouquet_bloom-0.1.0-cp311-abi3-macosx_10_12_x86_64.whl
Size 237.3 kB
Tags CPython 3.11 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
2dc82fefbbce3730029dac544725503ba6f4d24ce8cf9b567c0205ca86d7ae98
BLAKE2b-256 checksum
How to use checksums
f7a04888c625f6684fccc9681f9651328460a401646639c0fe728e32dd18970a
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 21, 2026.

Transparency log

Security for bouquet-bloom 0.1.0

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.0.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 21, 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