Skip to main content

Narrow Down - Efficient near-duplicate search

PyPI - Version PyPI - Python Version Tests Codecov License

Project Status: Active – The project has reached a stable, usable state and is being actively developed. Black pre-commit Contributor Covenant

Narrow Down offers a flexible but easy-to-use Python API to finding duplicates or similar documents also in very large datasets. It reduces the O(n²) problem of comparing all strings with each other to linear scale by using approximation algorithms like Locality Sensitive Hashing.

Features

  • Document indexing and search based on the Minhash LSH algorithm
  • High performance thanks to a native extension module in Rust
  • Easy-to-use API with automated parameter tuning
  • Works with exchangeable storage backends. Currently implemented:
    • In-Memory
    • Cassandra / ScyllaDB
    • SQLite
    • User defined backends (by implementing a small interface)
  • Native asyncio interface

Installation

The Python package can be installed with pip:

pip install narrow-down

Extras

Some of the heavier functionality is available as extra:

pip install narrow-down[scylladb]   # Cassandra / ScyllaDB storage backend

Similar projects

  • pylsh offers a good implementation of the classic Minhash LSH scheme in Python and Cython. If you only need this and you don't need a database backend it can be a good choice.
  • Datasketch implements an interesting collection of different data sketching algorithms for similarity matching, cardinality estimation and k-nearest-neighbour search. The implementation is not highly optimized but very well usable, the documentation rich and multiple database backends can be used for some of the sketches
  • Milvus offers a full database stack for vector search, a different approach for fast searching. It can also be applied to text search when an embedding like Word2Vec or Bert is used to vectorize the text.

Credits

This package was created with Cookiecutter and the fedejaure/cookiecutter-modern-pypackage project template.

Metadata

Release files for narrow-down 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for narrow-down 1.1.0
File Interpreter ABI Platform
narrow_down-1.1.0-cp37-abi3-win_amd64.whl CPython 3.7 abi3 Windows x86-64 Details
narrow_down-1.1.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.7 abi3 Linux glibc 2.17+ x86-64 Details
narrow_down-1.1.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl CPython 3.7 abi3 macOS 11.0+ ARM64, macOS 10.9+ universal2 (ARM64, x86-64), macOS 10.9+ x86-64 Details

Total release size: 2.3 MB

Release files / narrow_down-1.1.0-cp37-abi3-win_amd64.whl

Download URL narrow_down-1.1.0-cp37-abi3-win_amd64.whl
Size 268.7 kB
Tags CPython 3.7 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
221fba17c9e8345b72ea6f7d0e7932125d5bfd7410b6da0be58f2c55aa4199f2
BLAKE2b-256 checksum
How to use checksums
63a6f9a8dd6cb98ee67503aecdd200c2e80fc36a3ceb1b4cefc600b86378f31c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.17

Release files / narrow_down-1.1.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL narrow_down-1.1.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 1.3 MB
Tags CPython 3.7 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
861c142814eb3fcc2bf161bb38bb06c7a397fc59a98163febb5bd9692c486965
BLAKE2b-256 checksum
How to use checksums
f94e7cc1c14fb4ee11798923f312f52c5fa2c78a43cdd0493e59b97471279799
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.17

Release files / narrow_down-1.1.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl

Download URL narrow_down-1.1.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Size 773.0 kB
Tags CPython 3.7 abi3 macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
c81fec8a317fb60af0987d8180d292826dceab62360c727b9100a20784d17193
BLAKE2b-256 checksum
How to use checksums
b26f5c9b8adba768c030f6a8287c91fc9258f69f5e1ac1b5d6666e4c41a47276
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via maturin/0.14.17

Security for narrow-down 1.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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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