Skip to main content

A pure Python Levenshtein implementation that's not freaking GPL'd.

Project description

A pure Python Levenshtein implementation that’s not freaking GPL’d.

Based off the Wikipedia code samples at http://en.wikipedia.org/wiki/Levenshtein_distance.

Requirements

  • Python 2.7.X, Python 3.3+ or PyPy 1.6.0+

Usage

Usage is fairly straightforward.:

import pylev
distance = pylev.levenshtein('kitten', 'sitting')
assert(distance, 3)

License

New BSD.

Tests

Setup:

$ git clone https://github.com/toastdriven/pylev.git
$ cd pylev
$ virtualenv env --distribute
$ . env/bin/activate
$ pip install unittest2

Running:

$ python -m unittest2 tests

Version History

  • v1.2.0

    • Fixed all incorrect spellings of “Levenshtein” (there’s no “c” in it).

    • Old methods are aliased for backward-compatibility.

  • v1.1.0

    • Implemented a much faster variant (several orders of magnitude).

    • The older variant was renamed to classic_levenschtein.

    • Tested & working on Python 3.3 & PyPy 1.6.0 as well.

  • v1.0.2

    • Python packaging is REALLY hard. Including the README this time.

  • v1.0.1

    • Python packaging is hard. Including the README this time.

  • v1.0.0

    • Initial release, just the naive implementation of Levenshtein.

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

pylev-1.2.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

pylev-1.2.0-py2.py3-none-any.whl (4.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file pylev-1.2.0.tar.gz.

File metadata

  • Download URL: pylev-1.2.0.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pylev-1.2.0.tar.gz
Algorithm Hash digest
SHA256 0187706ab2fa9db9f1bf4976b5f8a1fc69f04e005f535672147da9c79669bfa1
MD5 b8137144cc0b0f687f0743db524e0f8b
BLAKE2b-256 4932ae7248aa0b459475994d44917639d9b7a9b0208c71fc9142a381d9776797

See more details on using hashes here.

File details

Details for the file pylev-1.2.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pylev-1.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 ded6f7b40ed01b7717f66303ac5e0c2d7a0b78c40f98ecd7e40d946e2176fdc0
MD5 f74ffdbcb5aa26b8635010483ef74d62
BLAKE2b-256 4cc1fbf1e7949bf8a9d96512a3d236e2f51b1c185fedf858b97e53393d6a0f63

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