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 Conda Version Python versions
Gitter chat Documentation 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 you're forced to adopt the GPL 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. More details on these performance improvements in form of benchmarks can be found here

Requirements

Installation

There are several ways to install RapidFuzz, the recommended methods are to either use pip(the Python package manager) or conda (an open-source, cross-platform, package manager)

with pip

RapidFuzz can be installed with pip the following way:

pip install rapidfuzz

There are pre-built binaries (wheels) of RapidFuzz for MacOS (10.9 and later), Linux x86_64 and Windows. Wheels for armv6l (Raspberry Pi Zero) and armv7l (Raspberry Pi) are available on piwheels.

:heavy_multiplication_x:   failure "ImportError: DLL load failed"

If you run into this error on Windows the reason is most likely, that the Visual C++ 2019 redistributable is not installed, which is required to find C++ Libraries (The C++ 2019 version includes the 2015, 2017 and 2019 version).

with conda

RapidFuzz can be installed with conda:

conda install -c conda-forge rapidfuzz

from git

RapidFuzz can be installed directly from the source distribution by cloning the repository. This requires a C++14 capable compiler.

git clone https://github.com/maxbachmann/rapidfuzz.git
cd rapidfuzz
pip install .

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, 1), ('New York Giants', 78.57142639160156, 2)]
> process.extractOne("cowboys", choices)
("Dallas Cowboys", 90, 3)

License

RapidFuzz is licensed under the MIT license since I believe that everyone should be able to use it without being forced to adopt the GPL license. Thats why the library is based on an older version of fuzzywuzzy that was MIT licensed as well. 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.14.2.tar.gz (58.4 kB view hashes)

Uploaded Source

Built Distributions

rapidfuzz-0.14.2-pp37-pypy37_pp73-win32.whl (115.4 kB view hashes)

Uploaded PyPy Windows x86

rapidfuzz-0.14.2-pp37-pypy37_pp73-manylinux2010_x86_64.whl (311.9 kB view hashes)

Uploaded PyPy manylinux: glibc 2.12+ x86-64

rapidfuzz-0.14.2-pp37-pypy37_pp73-macosx_10_9_x86_64.whl (255.5 kB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

rapidfuzz-0.14.2-pp36-pypy36_pp73-win32.whl (115.4 kB view hashes)

Uploaded PyPy Windows x86

rapidfuzz-0.14.2-pp36-pypy36_pp73-manylinux2010_x86_64.whl (311.9 kB view hashes)

Uploaded PyPy manylinux: glibc 2.12+ x86-64

rapidfuzz-0.14.2-pp36-pypy36_pp73-macosx_10_9_x86_64.whl (255.5 kB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

rapidfuzz-0.14.2-pp27-pypy_73-win32.whl (79.5 kB view hashes)

Uploaded PyPy Windows x86

rapidfuzz-0.14.2-pp27-pypy_73-manylinux2010_x86_64.whl (213.5 kB view hashes)

Uploaded PyPy manylinux: glibc 2.12+ x86-64

rapidfuzz-0.14.2-pp27-pypy_73-macosx_10_9_x86_64.whl (155.2 kB view hashes)

Uploaded PyPy macOS 10.9+ x86-64

rapidfuzz-0.14.2-cp39-cp39-win_amd64.whl (195.9 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

rapidfuzz-0.14.2-cp39-cp39-win32.whl (115.4 kB view hashes)

Uploaded CPython 3.9 Windows x86

rapidfuzz-0.14.2-cp39-cp39-manylinux2010_x86_64.whl (4.4 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ x86-64

rapidfuzz-0.14.2-cp39-cp39-manylinux2010_i686.whl (4.4 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.12+ i686

rapidfuzz-0.14.2-cp39-cp39-manylinux1_x86_64.whl (2.8 MB view hashes)

Uploaded CPython 3.9

rapidfuzz-0.14.2-cp39-cp39-manylinux1_i686.whl (2.6 MB view hashes)

Uploaded CPython 3.9

rapidfuzz-0.14.2-cp39-cp39-macosx_10_9_x86_64.whl (286.1 kB view hashes)

Uploaded CPython 3.9 macOS 10.9+ x86-64

rapidfuzz-0.14.2-cp38-cp38-win_amd64.whl (195.6 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

rapidfuzz-0.14.2-cp38-cp38-win32.whl (115.3 kB view hashes)

Uploaded CPython 3.8 Windows x86

rapidfuzz-0.14.2-cp38-cp38-manylinux2010_x86_64.whl (4.4 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

rapidfuzz-0.14.2-cp38-cp38-manylinux2010_i686.whl (4.4 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.12+ i686

rapidfuzz-0.14.2-cp38-cp38-manylinux1_x86_64.whl (2.8 MB view hashes)

Uploaded CPython 3.8

rapidfuzz-0.14.2-cp38-cp38-manylinux1_i686.whl (2.6 MB view hashes)

Uploaded CPython 3.8

rapidfuzz-0.14.2-cp38-cp38-macosx_10_9_x86_64.whl (286.3 kB view hashes)

Uploaded CPython 3.8 macOS 10.9+ x86-64

rapidfuzz-0.14.2-cp37-cp37m-win_amd64.whl (196.0 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

rapidfuzz-0.14.2-cp37-cp37m-win32.whl (115.3 kB view hashes)

Uploaded CPython 3.7m Windows x86

rapidfuzz-0.14.2-cp37-cp37m-manylinux2010_x86_64.whl (4.4 MB view hashes)

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

rapidfuzz-0.14.2-cp37-cp37m-manylinux2010_i686.whl (4.4 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.12+ i686

rapidfuzz-0.14.2-cp37-cp37m-manylinux1_x86_64.whl (2.8 MB view hashes)

Uploaded CPython 3.7m

rapidfuzz-0.14.2-cp37-cp37m-manylinux1_i686.whl (2.6 MB view hashes)

Uploaded CPython 3.7m

rapidfuzz-0.14.2-cp37-cp37m-macosx_10_9_x86_64.whl (286.2 kB view hashes)

Uploaded CPython 3.7m macOS 10.9+ x86-64

rapidfuzz-0.14.2-cp36-cp36m-win_amd64.whl (196.0 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

rapidfuzz-0.14.2-cp36-cp36m-win32.whl (115.3 kB view hashes)

Uploaded CPython 3.6m Windows x86

rapidfuzz-0.14.2-cp36-cp36m-manylinux2010_x86_64.whl (4.4 MB view hashes)

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

rapidfuzz-0.14.2-cp36-cp36m-manylinux2010_i686.whl (4.4 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.12+ i686

rapidfuzz-0.14.2-cp36-cp36m-manylinux1_x86_64.whl (2.8 MB view hashes)

Uploaded CPython 3.6m

rapidfuzz-0.14.2-cp36-cp36m-manylinux1_i686.whl (2.6 MB view hashes)

Uploaded CPython 3.6m

rapidfuzz-0.14.2-cp36-cp36m-macosx_10_9_x86_64.whl (286.2 kB view hashes)

Uploaded CPython 3.6m macOS 10.9+ x86-64

rapidfuzz-0.14.2-cp35-cp35m-win_amd64.whl (196.0 kB view hashes)

Uploaded CPython 3.5m Windows x86-64

rapidfuzz-0.14.2-cp35-cp35m-win32.whl (115.3 kB view hashes)

Uploaded CPython 3.5m Windows x86

rapidfuzz-0.14.2-cp35-cp35m-manylinux2010_x86_64.whl (4.4 MB view hashes)

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

rapidfuzz-0.14.2-cp35-cp35m-manylinux2010_i686.whl (4.4 MB view hashes)

Uploaded CPython 3.5m manylinux: glibc 2.12+ i686

rapidfuzz-0.14.2-cp35-cp35m-manylinux1_x86_64.whl (2.8 MB view hashes)

Uploaded CPython 3.5m

rapidfuzz-0.14.2-cp35-cp35m-manylinux1_i686.whl (2.6 MB view hashes)

Uploaded CPython 3.5m

rapidfuzz-0.14.2-cp35-cp35m-macosx_10_9_x86_64.whl (276.5 kB view hashes)

Uploaded CPython 3.5m macOS 10.9+ x86-64

rapidfuzz-0.14.2-cp27-cp27mu-manylinux2010_x86_64.whl (2.5 MB view hashes)

Uploaded CPython 2.7mu manylinux: glibc 2.12+ x86-64

rapidfuzz-0.14.2-cp27-cp27mu-manylinux2010_i686.whl (2.4 MB view hashes)

Uploaded CPython 2.7mu manylinux: glibc 2.12+ i686

rapidfuzz-0.14.2-cp27-cp27mu-manylinux1_x86_64.whl (1.6 MB view hashes)

Uploaded CPython 2.7mu

rapidfuzz-0.14.2-cp27-cp27mu-manylinux1_i686.whl (1.5 MB view hashes)

Uploaded CPython 2.7mu

rapidfuzz-0.14.2-cp27-cp27m-win_amd64.whl (115.5 kB view hashes)

Uploaded CPython 2.7m Windows x86-64

rapidfuzz-0.14.2-cp27-cp27m-win32.whl (79.3 kB view hashes)

Uploaded CPython 2.7m Windows x86

rapidfuzz-0.14.2-cp27-cp27m-manylinux2010_x86_64.whl (2.5 MB view hashes)

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

rapidfuzz-0.14.2-cp27-cp27m-manylinux2010_i686.whl (2.4 MB view hashes)

Uploaded CPython 2.7m manylinux: glibc 2.12+ i686

rapidfuzz-0.14.2-cp27-cp27m-manylinux1_x86_64.whl (1.6 MB view hashes)

Uploaded CPython 2.7m

rapidfuzz-0.14.2-cp27-cp27m-manylinux1_i686.whl (1.5 MB view hashes)

Uploaded CPython 2.7m

rapidfuzz-0.14.2-cp27-cp27m-macosx_10_9_x86_64.whl (168.5 kB view hashes)

Uploaded CPython 2.7m macOS 10.9+ 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