Skip to main content

A pure Python Levenschtein 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.levenschtein('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.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 Levenschtein.

Metadata

Release files for pylev 1.1.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.1.0
File Size Uploaded
pylev-1.1.0.tar.gz 3.1 kB Details

Release files / pylev-1.1.0.tar.gz

Download URL pylev-1.1.0.tar.gz
Size 3.1 kB
Tags Source
SHA-256 checksum
How to use checksums
569e038dbb863396e6bbd3b1cdd44a50559f4a046422e864c5cc6d2429cd624f
BLAKE2b-256 checksum
How to use checksums
f3a7d48071f549aea73a7ed513e0e87a9754d1181e35e094d21970d38a09031e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

1.4.0

2 release files

1.3.0

2 release files

1.2.0

2 release files

This release

1.1.0 This release

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