Probabilistic data structures for processing and searching very large datasets
Project description
datasketch gives you probabilistic data structures that can process and search very large amount of data super fast, with little loss of accuracy.
This package contains the following data sketches:
Data Sketch |
Usage |
|---|---|
estimate Jaccard similarity and cardinality |
|
estimate weighted Jaccard similarity |
|
estimate cardinality |
|
estimate cardinality |
The following indexes for data sketches are provided to support sub-linear query time:
Index |
For Data Sketch |
Supported Query Type |
|---|---|---|
MinHash, Weighted MinHash |
Jaccard Threshold |
|
MinHash, Weighted MinHash |
Jaccard Threshold |
|
MinHash, Weighted MinHash |
Jaccard Top-K |
|
MinHash |
Containment Threshold |
|
Any |
Custom Metric Top-K |
datasketch must be used with Python 3.9 or above, NumPy 1.11 or above, and Scipy.
Note that MinHash LSH and MinHash LSH Ensemble also support Redis and Cassandra storage layer (see MinHash LSH at Scale).
Install
To install datasketch using pip:
pip install datasketch
This will also install NumPy as dependency.
To install with Redis dependency:
pip install datasketch[redis]
To install with Cassandra dependency:
pip install datasketch[cassandra]
To install with Bloom filter dependency:
pip install datasketch[bloom]
Contributing
We welcome contributions from everyone. Whether you’re fixing bugs, adding features, improving documentation, or helping with tests, your contributions are valuable.
Development Setup
The project uses uv for fast and reliable Python package management. Follow these steps to set up your development environment:
Install uv: Follow the official installation guide at https://docs.astral.sh/uv/getting-started/installation/
Clone the repository:
git clone https://github.com/ekzhu/datasketch.git cd datasketchSet up the environment:
# Create a virtual environment # (Optional: specify Python version with --python 3.x) uv venv # Activate the virtual environment (optional, uv run commands work without it) source .venv/bin/activate # Install all dependencies uv syncVerify installation:
# Run tests to ensure everything works uv run pytestOptional dependencies (for specific development needs):
# For testing uv sync --extra test # For Cassandra support uv sync --extra cassandra # For Redis support uv sync --extra redis # For all extras uv sync --all-extras
Learn more about uv at https://docs.astral.sh/uv/
Development Workflow
Fork the repository on GitHub if you haven’t already.
Create a feature branch for your changes:
git checkout -b feature/your-feature-name # Or for bug fixes: git checkout -b fix/issue-descriptionMake your changes following the project’s coding standards.
Run the tests to ensure nothing is broken:
uv run pytestCheck code quality with ruff:
# Check for issues uvx ruff check . # Auto-fix formatting issues uvx ruff format .Commit your changes with a clear, descriptive commit message:
git commit -m "Add feature: brief description of what was changed"Push to your fork and create a pull request on GitHub:
git push origin your-branch-nameRespond to feedback from maintainers and iterate on your changes.
Guidelines
Follow PEP 8 style guidelines
Write tests for new features
Update documentation as needed
Keep commits focused and atomic
Be respectful in discussions
For more information, check the GitHub issues for current priorities or areas needing help. You can also join the discussion on project roadmap and priorities.
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 Distribution
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 datasketch-1.9.0.tar.gz.
File metadata
- Download URL: datasketch-1.9.0.tar.gz
- Upload date:
- Size: 89.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
78d4560e415b0de11f595165887a0e4c9983d07b8f15dce9c53289a86bc12e92
|
|
| MD5 |
9b0340e767bedd547c418cae17f052dd
|
|
| BLAKE2b-256 |
1fd10b64dbc7626be277413daff298b9f026911389e75562952d5b7c662bbea1
|
Provenance
The following attestation bundles were made for datasketch-1.9.0.tar.gz:
Publisher:
pypi.yml on ekzhu/datasketch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
datasketch-1.9.0.tar.gz -
Subject digest:
78d4560e415b0de11f595165887a0e4c9983d07b8f15dce9c53289a86bc12e92 - Sigstore transparency entry: 833841461
- Sigstore integration time:
-
Permalink:
ekzhu/datasketch@a1c1e292c08e052aaa9557115098c1e289344f9e -
Branch / Tag:
refs/heads/master - Owner: https://github.com/ekzhu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@a1c1e292c08e052aaa9557115098c1e289344f9e -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file datasketch-1.9.0-py3-none-any.whl.
File metadata
- Download URL: datasketch-1.9.0-py3-none-any.whl
- Upload date:
- Size: 96.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48c18ae889862793609971c6d6d392d71c86793e838dbddd8aa53af6b1716e8a
|
|
| MD5 |
fa99ea79031498eef950550a7e5d663a
|
|
| BLAKE2b-256 |
fbc8ef06f4c9a0d7697c14c39475eaccd7d3774c34ecc693691079a21bd0d1f1
|
Provenance
The following attestation bundles were made for datasketch-1.9.0-py3-none-any.whl:
Publisher:
pypi.yml on ekzhu/datasketch
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
datasketch-1.9.0-py3-none-any.whl -
Subject digest:
48c18ae889862793609971c6d6d392d71c86793e838dbddd8aa53af6b1716e8a - Sigstore transparency entry: 833841463
- Sigstore integration time:
-
Permalink:
ekzhu/datasketch@a1c1e292c08e052aaa9557115098c1e289344f9e -
Branch / Tag:
refs/heads/master - Owner: https://github.com/ekzhu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yml@a1c1e292c08e052aaa9557115098c1e289344f9e -
Trigger Event:
workflow_dispatch
-
Statement type: