Skip to main content

rapid fuzzy string matching

Project description

RapidFuzz

Rapid fuzzy string matching in Python and C++ using the Levenshtein Distance

Continous Integration PyPI package version Python versions GitHub license

DescriptionInstallationUsageLicense


Description

RapidFuzz is a fast string matching library for Python and C++, which is using the string similarity calculations from FuzzyWuzzy. However there are two aspects that set RapidFuzz apart from FuzzyWuzzy:

  1. It is MIT licensed so it can be used whichever License you might want to choose for your project, while your forced to adopt the GPLv2 license when using FuzzyWuzzy
  2. It is mostly written in C++ and on top of this comes with a lot of Algorithmic improvements to make string matching even faster, while still providing the same results. These changes result in a 5-100x Speedup in String Matching. More details on benchmark results can be found here

Installation

RapidFuzz can be installed using pip

$ pip install rapidfuzz

it requires Python 3.5 or later and a C++ Compiler with C++17 support, which should be given on all current systems

Usage

> from rapidfuzz import fuzz
> from rapidfuzz import process

Simple Ratio

> fuzz.ratio("this is a test", "this is a test!")
96.55171966552734

Partial Ratio

> fuzz.partial_ratio("this is a test", "this is a test!")
100.0

Token Sort Ratio

> fuzz.ratio("fuzzy wuzzy was a bear", "wuzzy fuzzy was a bear")
90.90908813476562
> fuzz.token_sort_ratio("fuzzy wuzzy was a bear", "wuzzy fuzzy was a bear")
100.0

Token Set Ratio

> fuzz.token_sort_ratio("fuzzy was a bear", "fuzzy fuzzy was a bear")
83.8709716796875
> fuzz.token_set_ratio("fuzzy was a bear", "fuzzy fuzzy was a bear")
100.0

Process

> choices = ["Atlanta Falcons", "New York Jets", "New York Giants", "Dallas Cowboys"]
> process.extract("new york jets", choices, limit=2)
[('new york jets', 100), ('new york giants', 78.57142639160156)]
> process.extractOne("cowboys", choices)
("dallas cowboys", 90)

License

RapidFuzz is licensed under the MIT license since we believe that everyone should be able to use it without being forced to adopt our license. Thats why the library is based on an older version of fuzzywuzzy that was MIT licensed aswell. A Fork of this old version of fuzzywuzzy can be found here.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

rapidfuzz-0.2.1.tar.gz (13.1 kB view hashes)

Uploaded Source

Built Distributions

rapidfuzz-0.2.1-cp38-cp38-win_amd64.whl (72.5 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

rapidfuzz-0.2.1-cp38-cp38-win32.whl (62.6 kB view hashes)

Uploaded CPython 3.8 Windows x86

rapidfuzz-0.2.1-cp38-cp38-manylinux2010_x86_64.whl (1.2 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

rapidfuzz-0.2.1-cp38-cp38-manylinux2010_i686.whl (903.0 kB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ i686

rapidfuzz-0.2.1-cp38-cp38-macosx_10_15_x86_64.whl (80.6 kB view hashes)

Uploaded CPython 3.8 macOS 10.15+ x86-64

rapidfuzz-0.2.1-cp37-cp37m-win_amd64.whl (72.7 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

rapidfuzz-0.2.1-cp37-cp37m-win32.whl (63.6 kB view hashes)

Uploaded CPython 3.7m Windows x86

rapidfuzz-0.2.1-cp37-cp37m-manylinux2010_x86_64.whl (1.3 MB view hashes)

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

rapidfuzz-0.2.1-cp37-cp37m-manylinux2010_i686.whl (903.1 kB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ i686

rapidfuzz-0.2.1-cp37-cp37m-macosx_10_15_x86_64.whl (79.9 kB view hashes)

Uploaded CPython 3.7m macOS 10.15+ x86-64

rapidfuzz-0.2.1-cp36-cp36m-win_amd64.whl (72.7 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

rapidfuzz-0.2.1-cp36-cp36m-win32.whl (63.6 kB view hashes)

Uploaded CPython 3.6m Windows x86

rapidfuzz-0.2.1-cp36-cp36m-manylinux2010_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ x86-64

rapidfuzz-0.2.1-cp36-cp36m-manylinux2010_i686.whl (901.8 kB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ i686

rapidfuzz-0.2.1-cp36-cp36m-macosx_10_15_x86_64.whl (79.8 kB view hashes)

Uploaded CPython 3.6m macOS 10.15+ x86-64

rapidfuzz-0.2.1-cp35-cp35m-win_amd64.whl (72.7 kB view hashes)

Uploaded CPython 3.5m Windows x86-64

rapidfuzz-0.2.1-cp35-cp35m-win32.whl (63.6 kB view hashes)

Uploaded CPython 3.5m Windows x86

rapidfuzz-0.2.1-cp35-cp35m-manylinux2010_x86_64.whl (1.3 MB view hashes)

Uploaded CPython 3.5m manylinux: glibc 2.12+ x86-64

rapidfuzz-0.2.1-cp35-cp35m-manylinux2010_i686.whl (901.7 kB view hashes)

Uploaded CPython 3.5m manylinux: glibc 2.12+ i686

rapidfuzz-0.2.1-cp35-cp35m-macosx_10_15_x86_64.whl (77.8 kB view hashes)

Uploaded CPython 3.5m macOS 10.15+ x86-64

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