Skip to main content

No project description provided

Project description

FuzzDex

Fuzzy Index for Python, written in Rust. Works like an error-tolerant dict, keyed by a human input.

Usecases

I use it for matching parts of user supplied physical addresses to data extracted from OSM map to find streets and cities. Original solution used Elasticsearch database with a fuzzy query, which worked - but was 21x slower.

Example

import fuzzdex
cities = fuzzdex.FuzzDex(max_distance=2)
cities.add_phrase("Warsaw", 1, constraints={1, 2, 3})
cities.add_phrase("Wrocław", 2, constraints={4})

streets = fuzzdex.FuzzDex()
streets.add_phrase("Czerniakowska", 1, constraints={1})
streets.add_phrase("Nowy Świat", 2, constraints={1})
streets.add_phrase("Wawelska", 3, constraints={1})

streets.add_phrase("Czerniawska", 4, constraints={2})

cities.finish()
streets.finish()

cities.search("Warszawa", [], max_distance=3, limit=60)
#    [{'origin': 'Warsaw', 'index': 1, 'token': 'warsaw', 
#      'distance': 3, 'score': 100000.0, 'should_score': 0.0}]
 
streets.search("Nowy", ["świat"], max_distance=2, constraint=1)
#    [{'origin': 'Nowy Świat', 'index': 2, 'token': 'nowy', 
#      'distance': 1, 'score': 1.4999924898147583, 
#      'should_score': 7.499962329864502}]

streets.search("Nowy", ["świat"], constraint=2)
#    []

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

fuzzdex-0.3.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.5+ x86-64

fuzzdex-0.3.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.5+ x86-64

fuzzdex-0.3.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl (1.6 MB view details)

Uploaded CPython 3.7m manylinux: glibc 2.5+ x86-64

File details

Details for the file fuzzdex-0.3.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for fuzzdex-0.3.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f04232a00974d35cb02e484482681594b30607be38d989560527519a4777a444
MD5 1c8d2c61f10760dca972535668ab43f8
BLAKE2b-256 2b388b0fe72355ec10a4abee414235c37c11c8e8def3d67f36b9b46d97f2cd2b

See more details on using hashes here.

File details

Details for the file fuzzdex-0.3.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for fuzzdex-0.3.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 069aecea7d17d084e9733f5257bb2d882863a0bd3649cd7232bd716c172a19b3
MD5 47455d4f6134360a833326f4c94b411f
BLAKE2b-256 11aa9553feb9c81702f0ac6bcc64b097c84f4dc2385a5632e864fa4b44102edc

See more details on using hashes here.

File details

Details for the file fuzzdex-0.3.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for fuzzdex-0.3.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f7866c00e4f854e47b6d389cf16b43e0a5f53655b25fc6378d706d78e023e9dd
MD5 83fca117be3275ec9d089fd01b949c42
BLAKE2b-256 d52bf2768807ae384aa01f0e0410ca4bcc80b18cf17075d452f6c07b12840907

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