Skip to main content

A library for string matching between two lists.

Project description

Installation

The library requries Python>=3.8 and to install the package simply run:

pip install levenshtein_matching

Why

Performing string matching between to lists is an $n\times m$ operation. Depending on your use case and the size of the lists you want to match this becomes unfeasible. This library exists to leverage Rust's performance to decrease run time for such operations.

Example

from levenshtein_matching import find_best_match_levenshtein

target = [("String 1", 1), ("String 2", 2)]
query = [("String 2", 0.8), ("String 1", 0.5)]
threshold = 0.9

target_values, query_values = find_best_match_levenshtein(target, query, threshold)
print(f"Target values: {target_values}")
print(f"Query values: {query_values}")

Output:

Target values: [2, 1]
Query values: [0.8, 0.5]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

levenshtein_matching-0.5.2.tar.gz (16.8 kB view details)

Uploaded Source

Built Distribution

levenshtein_matching-0.5.2-cp312-cp312-manylinux_2_34_x86_64.whl (248.6 kB view details)

Uploaded CPython 3.12 manylinux: glibc 2.34+ x86-64

File details

Details for the file levenshtein_matching-0.5.2.tar.gz.

File metadata

File hashes

Hashes for levenshtein_matching-0.5.2.tar.gz
Algorithm Hash digest
SHA256 39794023760632ef8f8fef97d5ec6c11de05b56e16c4cb26627c9d4a52826136
MD5 fd7860f93335bf2b9865b7274862bf5b
BLAKE2b-256 fcc448842c87609b9715218fb304b44d564ba10541b64a7cb36bd704c5560a0e

See more details on using hashes here.

File details

Details for the file levenshtein_matching-0.5.2-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for levenshtein_matching-0.5.2-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 fb9cd20a81d41a3fffc484cb4ac31d341b2bf4ad7cb994f618ad5c3af7ad462a
MD5 508d4c08ba83f8744fc38b93000341f3
BLAKE2b-256 327c614cb3bfe5c6994f9b102a97c6b16bbebe8b0f453e5988dfc095998550ec

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page