Skip to main content

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

Running:

$ python -m unittest tests

[![Build Status](https://travis-ci.org/toastdriven/pylev.png)](https://travis-ci.org/toastdriven/pylev)

Version History

  • v1.3.0

    • Implemented a considerably faster variants (orders of magnitude).

    • Tested & working on Python 2.7.4, Python 3.3.1 & PyPy 1.9.0.

  • 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.

Metadata

Release files for pylev 1.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pylev 1.3.0
File Size Uploaded
pylev-1.3.0.tar.gz 3.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pylev 1.3.0
File Interpreter ABI Platform
pylev-1.3.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 8.1 kB

Release files / pylev-1.3.0.tar.gz

Download URL pylev-1.3.0.tar.gz
Size 3.2 kB
Tags Source
SHA-256 checksum
How to use checksums
063910098161199b81e453025653ec53556c1be7165a9b7c50be2f4d57eae1c3
BLAKE2b-256 checksum
How to use checksums
cc61dab2081d3d86dcf0b9f5dcfb11b256d76cd14aad7ccdd7c8dd5e7f7e41a0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pylev-1.3.0-py2.py3-none-any.whl

Download URL pylev-1.3.0-py2.py3-none-any.whl
Size 4.9 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
1d29a87beb45ebe1e821e7a3b10da2b6b2f4c79b43f482c2df1a1f748a6e114e
BLAKE2b-256 checksum
How to use checksums
401c7dff1d242bf1e19f9c6202f0ba4e6fd18cc7ecb8bc85b17b2d16c806e228
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

1.4.0

2 release files

This release

1.3.0 This release

2 release files

1.2.0

2 release files

1.1.0

1 release file

1.0.2

1 release file

1.0.1

1 release file

1.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page