deduplicate_lib
deduplication algorithms in python
Key Features
- Easy to use deduplication algorithms for any vector array
- Suite of tolerance tuning algorithms to help you find the right tolerance value for your system
- Suite of benchmarking tools to ensure rigor, accuracy, and speed (not yet implemented)
- Factory Plugin architecture, for easy extensibility and modification
Implemented Algorithms
- Distance Matrix (Simple, accurate, expensive): Computes the distance matrix for all vectors and determines duplicates by finding those that fall below a given distance
- Multi Hashing (Fast): Smears and rounds the vectors using a normal distribution and computes the hashes for each which are then used to determine duplicates by proportion of hash clashes.
Quick Start
pip install deduplicate_lib
from deduplicate_lib.plugins.duplicate_detection_algorithms.multi_hashing import MultiHashing
import numpy as np
dataset = np.array([[1.0, 2.0], [1.01, 2.01], [5.0, 6.0]])
dda = MultiHashing(tolerance=0.1, dataset_array=dataset)
# return unique vectors
print(dda.deduplicate())
# check a single vector against the dataset
dda.input_vector = np.array([1.0, 2.0])
print(dda.duplicate_check()) # True
See the full documentation for API reference, tolerance tuning, and more examples.
Dependencies
- Python 3.9+
numpynumbascipy
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Setup
# Clone the repository
git clone https://github.com/julianholland/deduplicate.git
cd deduplicate
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest
# Run linting
ruff check .
ruff format .
Running Tests
# Run all tests
pytest
# Run specific test categories
pytest tests/core/
pytest tests/plugins/
pytest tests/plugins/duplicate_detection_algorithms/distance_matrix
# Run with coverage
pytest --cov
📝 Citation
If you use deduplicate_lib in your research, please cite:
@software{deduplicate2026,
title={deduplicate_lib: Auto Tolerance Finding Deduplication Algorithms in Python},
author={Julian Holland},
year={2026},
url={https://github.com/julianholland/deduplicate},
version={0.0.5}
}
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- The Fritz Haber Institute
- Juan Manuel Lombardi <3
- Maximillion Ach
- Chiara Panosetti
Project Links
Project To-Do
- Add example.ipynb
- Create general Pre-allocation protocal
- Add benchmarks for time and robustness
- Add Locality-Sensitive Hashing as an option
- Speedup slow tasks with Numba
- Set up Read the Docs
- Create general deduplicate function
- Speed up NTPP
Metadata
Release files for deduplicate_lib 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| deduplicate_lib-0.1.1.tar.gz | 18.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| deduplicate_lib-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 39.5 kB
Release files / deduplicate_lib-0.1.1.tar.gz
| Download URL | deduplicate_lib-0.1.1.tar.gz |
|---|---|
| Size | 18.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5b9c3dd6cb27b3f1cee177b4db7ec97286521806cb1d0742ca58d9ffa1dfbff7
|
|
BLAKE2b-256 checksum How to use checksums |
c38fe73e6a0a0f5f8c297d52e41b1535b108ae7873588f2b2d2065915c57b07d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / deduplicate_lib-0.1.1-py3-none-any.whl
| Download URL | deduplicate_lib-0.1.1-py3-none-any.whl |
|---|---|
| Size | 21.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
86a7400502226b4d20c2dd44a22acb1479a385fe688a144d0b67868b40e777a9
|
|
BLAKE2b-256 checksum How to use checksums |
8e49cbd2f5b967ad208ec2964185d6a9f8147b261a800b1d6d87cd5b0f94ca10
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.9 {"installer":{"name":"uv","version":"0.12.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|