Scalable Cuckoo Filter implemented in Rust with Python bindings
Project description
scalable-cuckoo-filter-py
Python wrapper for sile/scalable_cuckoo_filter
See the crate that this wraps: https://docs.rs/scalable_cuckoo_filter/
This can be used as a probabilistic data structure for set membership tests. A cuckoo filter is similar to a Bloom filter, but it supports deletions.
This implementation is scalable, meaning that it can grow and shrink dynamically while maintinaing a low false positive rate.
Usage
Create the filter and add a few strings:
from scf import PyScalableCuckooFilter
scf = PyScalableCuckooFilter(1000, 0.001)
scf.insert("hello")
scf.insert("world")
Now we can do membership tests:
assert scf.might_contain("hello")
assert scf.might_contain("world")
assert not scf.might_contain("foo")
We can remove entries:
scf.remove("hello")
assert not scf.might_contain("hello")
We can save the filter to a file:
scf.write_to_file("filter.bin")
And load it back:
scf = PyScalableCuckooFilter.read_from_file("filter.bin")
assert scf.might_contain("world")
Types
These are the the types that can be used with the filter:
strbytesbytearrayintfloatbool- Iterables of the above types, with nesting.
For example, you can insert a list of integers:
scf = PyScalableCuckooFilter(1000, 0.001)
scf.insert([1, 2, 3]) # list
scf.insert([1, (2, [3])]) # list(tuple(list)))
However, note that all iterables will hash the same as each other. For example,
["foo", "bar"] and ("foo", "bar") will be regarded as the same key.
In fact, any iterable with the same elements will hash the same.
scf = PyScalableCuckooFilter(1000, 0.001)
scf.insert(range(3)) # iterable
assert scf.might_contain((0, 1, 2)) # tuple
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cjrh_scalable_cuckoo_filter-0.3.1.tar.gz.
File metadata
- Download URL: cjrh_scalable_cuckoo_filter-0.3.1.tar.gz
- Upload date:
- Size: 8.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0cd265855bcb8ed3453588f9c1ed2e55284115598155f916a2f340a162f1904
|
|
| MD5 |
f5cc86bc9758a2f5297525ace9280356
|
|
| BLAKE2b-256 |
494900700d9881ed555bd7c6a656bbfaccb3c59d5502890839d8595e2711bad3
|
Provenance
The following attestation bundles were made for cjrh_scalable_cuckoo_filter-0.3.1.tar.gz:
Publisher:
CI.yml on cjrh/scalable-cuckoo-filter-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cjrh_scalable_cuckoo_filter-0.3.1.tar.gz -
Subject digest:
d0cd265855bcb8ed3453588f9c1ed2e55284115598155f916a2f340a162f1904 - Sigstore transparency entry: 941171329
- Sigstore integration time:
-
Permalink:
cjrh/scalable-cuckoo-filter-py@91d08227ce2b6d764ae32017f9feb84d6046434a -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/cjrh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
CI.yml@91d08227ce2b6d764ae32017f9feb84d6046434a -
Trigger Event:
push
-
Statement type:
File details
Details for the file cjrh_scalable_cuckoo_filter-0.3.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: cjrh_scalable_cuckoo_filter-0.3.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 276.2 kB
- Tags: PyPy, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3be211dd764940043e62a26439bb09c5a9020356766f61b858d333efd4c01fd3
|
|
| MD5 |
92ea5d3ced8f794b5d767130ae0d01ec
|
|
| BLAKE2b-256 |
eaaa50c7f5569cdb2ec3919ca6defa7b5cb2c5b6c66430107b0c7c0908405583
|
Provenance
The following attestation bundles were made for cjrh_scalable_cuckoo_filter-0.3.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
CI.yml on cjrh/scalable-cuckoo-filter-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cjrh_scalable_cuckoo_filter-0.3.1-pp310-pypy310_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
3be211dd764940043e62a26439bb09c5a9020356766f61b858d333efd4c01fd3 - Sigstore transparency entry: 941171337
- Sigstore integration time:
-
Permalink:
cjrh/scalable-cuckoo-filter-py@91d08227ce2b6d764ae32017f9feb84d6046434a -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/cjrh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
CI.yml@91d08227ce2b6d764ae32017f9feb84d6046434a -
Trigger Event:
push
-
Statement type:
File details
Details for the file cjrh_scalable_cuckoo_filter-0.3.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: cjrh_scalable_cuckoo_filter-0.3.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 276.9 kB
- Tags: PyPy, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eb2871ff88d09a8aeaa8b8027d7bd1d0f689df5b4cbe64a74d2e4dce399208f6
|
|
| MD5 |
e2aea2cbae6a279dbc77ca73858bdd99
|
|
| BLAKE2b-256 |
363d9d9b77137f1f2883887a171de4b1b35a5d6ff6c90fa0e15da95f2e3eb527
|
Provenance
The following attestation bundles were made for cjrh_scalable_cuckoo_filter-0.3.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
CI.yml on cjrh/scalable-cuckoo-filter-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cjrh_scalable_cuckoo_filter-0.3.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
eb2871ff88d09a8aeaa8b8027d7bd1d0f689df5b4cbe64a74d2e4dce399208f6 - Sigstore transparency entry: 941171398
- Sigstore integration time:
-
Permalink:
cjrh/scalable-cuckoo-filter-py@91d08227ce2b6d764ae32017f9feb84d6046434a -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/cjrh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
CI.yml@91d08227ce2b6d764ae32017f9feb84d6046434a -
Trigger Event:
push
-
Statement type:
File details
Details for the file cjrh_scalable_cuckoo_filter-0.3.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: cjrh_scalable_cuckoo_filter-0.3.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 276.9 kB
- Tags: PyPy, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
762823cc234ccbef3eaf8b2117e7e367f24c110fbb8fa58ecb71db335b3e9c05
|
|
| MD5 |
31dfe18383ada51d41c0e70c9b2b8210
|
|
| BLAKE2b-256 |
c22597cbabd5520c30e3f868cd901a3546fd19b4f0e57ce6f508eea4c5da47c6
|
Provenance
The following attestation bundles were made for cjrh_scalable_cuckoo_filter-0.3.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
CI.yml on cjrh/scalable-cuckoo-filter-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cjrh_scalable_cuckoo_filter-0.3.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
762823cc234ccbef3eaf8b2117e7e367f24c110fbb8fa58ecb71db335b3e9c05 - Sigstore transparency entry: 941171363
- Sigstore integration time:
-
Permalink:
cjrh/scalable-cuckoo-filter-py@91d08227ce2b6d764ae32017f9feb84d6046434a -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/cjrh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
CI.yml@91d08227ce2b6d764ae32017f9feb84d6046434a -
Trigger Event:
push
-
Statement type:
File details
Details for the file cjrh_scalable_cuckoo_filter-0.3.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: cjrh_scalable_cuckoo_filter-0.3.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 278.7 kB
- Tags: PyPy, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b2dc56ff9e551e9fddf7839c7720136a2fbb886d4a2a997b9e85218d85ec15b0
|
|
| MD5 |
bb092ad8581c8ba1c3f5290820ddea28
|
|
| BLAKE2b-256 |
e41bb9ecdc558bda8d2723eb83e7b11c6824b778f892c44428b14b7014585256
|
Provenance
The following attestation bundles were made for cjrh_scalable_cuckoo_filter-0.3.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
CI.yml on cjrh/scalable-cuckoo-filter-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cjrh_scalable_cuckoo_filter-0.3.1-pp37-pypy37_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
b2dc56ff9e551e9fddf7839c7720136a2fbb886d4a2a997b9e85218d85ec15b0 - Sigstore transparency entry: 941171409
- Sigstore integration time:
-
Permalink:
cjrh/scalable-cuckoo-filter-py@91d08227ce2b6d764ae32017f9feb84d6046434a -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/cjrh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
CI.yml@91d08227ce2b6d764ae32017f9feb84d6046434a -
Trigger Event:
push
-
Statement type:
File details
Details for the file cjrh_scalable_cuckoo_filter-0.3.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: cjrh_scalable_cuckoo_filter-0.3.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 286.6 kB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4773a0c466db0de2a643569f113569eba5cda0054ad7c51efe3d6d16846d7637
|
|
| MD5 |
64428ff7248699e9777c2d9457ec8945
|
|
| BLAKE2b-256 |
e5efbacf46b5620bf98f10264c5d8526afd4a7d45344eb1603f1694973283457
|
Provenance
The following attestation bundles were made for cjrh_scalable_cuckoo_filter-0.3.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
CI.yml on cjrh/scalable-cuckoo-filter-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cjrh_scalable_cuckoo_filter-0.3.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
4773a0c466db0de2a643569f113569eba5cda0054ad7c51efe3d6d16846d7637 - Sigstore transparency entry: 941171382
- Sigstore integration time:
-
Permalink:
cjrh/scalable-cuckoo-filter-py@91d08227ce2b6d764ae32017f9feb84d6046434a -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/cjrh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
CI.yml@91d08227ce2b6d764ae32017f9feb84d6046434a -
Trigger Event:
push
-
Statement type:
File details
Details for the file cjrh_scalable_cuckoo_filter-0.3.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: cjrh_scalable_cuckoo_filter-0.3.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 276.7 kB
- Tags: CPython 3.10+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd46e40eaff82e764f20159f5423015a17e6149a7d7a037b9cfc35953dcc55ed
|
|
| MD5 |
fb85e89d54a060291f54661d8b7d5d9d
|
|
| BLAKE2b-256 |
d4b450a1f1419bcc9e9911abcd81ce8dd16162080e4402d27834987e3ac625c0
|
Provenance
The following attestation bundles were made for cjrh_scalable_cuckoo_filter-0.3.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
CI.yml on cjrh/scalable-cuckoo-filter-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cjrh_scalable_cuckoo_filter-0.3.1-cp310-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
fd46e40eaff82e764f20159f5423015a17e6149a7d7a037b9cfc35953dcc55ed - Sigstore transparency entry: 941171346
- Sigstore integration time:
-
Permalink:
cjrh/scalable-cuckoo-filter-py@91d08227ce2b6d764ae32017f9feb84d6046434a -
Branch / Tag:
refs/tags/v0.3.1 - Owner: https://github.com/cjrh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
CI.yml@91d08227ce2b6d764ae32017f9feb84d6046434a -
Trigger Event:
push
-
Statement type: