datasketch: Big Data Looks Small
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.
Metadata
Release files for datasketch 2.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| datasketch-2.0.0.tar.gz | 98.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| datasketch-2.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 205.9 kB
Release files / datasketch-2.0.0.tar.gz
| Download URL | datasketch-2.0.0.tar.gz |
|---|---|
| Size | 98.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e0570e170f7e64b8d6fb1cc2e4ce36a9f7036c5100167e50a0770addc50558c2
|
|
BLAKE2b-256 checksum How to use checksums |
daaebbcdeab67ebfe27747896618bca0f8113e79d534c5af2b06ce6693c981de
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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 Jul 5, 2026.
Transparency logRelease files / datasketch-2.0.0-py3-none-any.whl
| Download URL | datasketch-2.0.0-py3-none-any.whl |
|---|---|
| Size | 107.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
aea5ffafcce776e03d085740e78b874e778d779b07ee11ca636ca51b3fef09ed
|
|
BLAKE2b-256 checksum How to use checksums |
54df9e79bf1fb2f660507dbd00d24730d107595a2f599f2524a96344149c95f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.13
|
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 Jul 5, 2026.
Transparency log