Skip to main content

a library for doing approximate and phonetic matching of strings.

Project description

https://github.com/jamesturk/jellyfish/workflows/Python%20package/badge.svg https://coveralls.io/repos/jamesturk/jellyfish/badge.png?branch=master https://img.shields.io/pypi/v/jellyfish.svg Documentation Status

Jellyfish is a python library for doing approximate and phonetic matching of strings.

Written by James Turk <dev@jamesturk.net> and Michael Stephens.

See https://github.com/jamesturk/jellyfish/graphs/contributors for contributors.

See http://jellyfish.readthedocs.io for documentation.

Source is available at http://github.com/jamesturk/jellyfish.

Jellyfish >= 0.7 only supports Python 3, if you need Python 2 please use 0.6.x.

Included Algorithms

String comparison:

  • Levenshtein Distance

  • Damerau-Levenshtein Distance

  • Jaro Distance

  • Jaro-Winkler Distance

  • Match Rating Approach Comparison

  • Hamming Distance

Phonetic encoding:

  • American Soundex

  • Metaphone

  • NYSIIS (New York State Identification and Intelligence System)

  • Match Rating Codex

Example Usage

>>> import jellyfish
>>> jellyfish.levenshtein_distance(u'jellyfish', u'smellyfish')
2
>>> jellyfish.jaro_distance(u'jellyfish', u'smellyfish')
0.89629629629629637
>>> jellyfish.damerau_levenshtein_distance(u'jellyfish', u'jellyfihs')
1
>>> jellyfish.metaphone(u'Jellyfish')
'JLFX'
>>> jellyfish.soundex(u'Jellyfish')
'J412'
>>> jellyfish.nysiis(u'Jellyfish')
'JALYF'
>>> jellyfish.match_rating_codex(u'Jellyfish')
'JLLFSH'

Running Tests

If you are interested in contributing to Jellyfish, you may want to run tests locally. Jellyfish uses tox to run tests, which you can setup and run as follows:

pip install tox
# cd jellyfish/
tox

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

jellyfish-0.8.4.tar.gz (137.0 kB view hashes)

Uploaded Source

Built Distributions

jellyfish-0.8.4-py3-none-any.whl (10.9 kB view hashes)

Uploaded Python 3

jellyfish-0.8.4-cp39-cp39-win_amd64.whl (27.9 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

jellyfish-0.8.4-cp39-cp39-macosx_10_14_x86_64.whl (24.5 kB view hashes)

Uploaded CPython 3.9 macOS 10.14+ x86-64

jellyfish-0.8.4-cp38-cp38-win_amd64.whl (27.9 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

jellyfish-0.8.4-cp38-cp38-macosx_10_14_x86_64.whl (24.5 kB view hashes)

Uploaded CPython 3.8 macOS 10.14+ x86-64

jellyfish-0.8.4-cp37-cp37m-win_amd64.whl (27.8 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

jellyfish-0.8.4-cp37-cp37m-macosx_10_14_x86_64.whl (24.4 kB view hashes)

Uploaded CPython 3.7m macOS 10.14+ x86-64

jellyfish-0.8.4-cp36-cp36m-win_amd64.whl (27.9 kB view hashes)

Uploaded CPython 3.6m Windows x86-64

jellyfish-0.8.4-cp36-cp36m-macosx_10_14_x86_64.whl (24.4 kB view hashes)

Uploaded CPython 3.6m macOS 10.14+ 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