{"id":5614,"library":"editdistance","title":"Editdistance","description":"Editdistance is a Python library providing a fast, C++ and Cython-optimized implementation of the Levenshtein (edit) distance. It efficiently calculates the minimum number of single-character edits (insertions, deletions, or substitutions) required to change one sequence into the other. The library is suitable for applications requiring high-performance string similarity calculations, such as fuzzy matching, data cleaning, and natural language processing. The current version is 0.8.1, but the project's GitHub repository has been archived, indicating it is no longer actively maintained by the owner.","status":"abandoned","version":"0.8.1","language":"en","source_language":"en","source_url":"https://github.com/roy-ht/editdistance","tags":["edit distance","levenshtein distance","string similarity","algorithm","fuzzy matching","cython","performance"],"install":[{"cmd":"pip install editdistance","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"note":"The primary function `eval` is accessed directly from the imported `editdistance` module, not as a class instance.","wrong":"from editdistance import editdistance","symbol":"eval","correct":"import editdistance\neditdistance.eval('string1', 'string2')"}],"quickstart":{"code":"import editdistance\n\n# Calculate edit distance between two strings\ndistance = editdistance.eval('kitten', 'sitting')\nprint(f\"Edit distance between 'kitten' and 'sitting': {distance}\")\n\n# Works with any iterable of hashable objects (e.g., lists of words)\ndistance_list = editdistance.eval(['spam', 'egg'], ['spam', 'ham'])\nprint(f\"Edit distance between ['spam', 'egg'] and ['spam', 'ham']: {distance_list}\")","lang":"python","description":"This example demonstrates how to calculate the Levenshtein distance between two strings or two sequences of hashable objects using the `editdistance.eval()` function."},"warnings":[{"fix":"Be aware of the project's archived status. Consider alternative actively maintained libraries for new projects or if critical updates are required. For existing projects, pin the version to 'editdistance==0.8.1'.","message":"The GitHub repository for `editdistance` (roy-ht/editdistance) was archived by the owner on June 30, 2025, making it read-only. This indicates that the library is no longer under active development or maintenance by its original creator, and new features or bug fixes are unlikely to be released.","severity":"breaking","affected_versions":"All versions post-June 2025"},{"fix":"Ensure you `pip install editdistance` (no underscore) and `import editdistance` (no underscore) to use the fast, Cython-backed implementation. Double-check your `requirements.txt` and import statements.","message":"A separate, pure-Python library named `edit_distance` (with an underscore) exists on PyPI. It has a different API, is typically slower, and is not the C++/Cython optimized `editdistance` library. Importing the wrong one is a common mistake.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Upgrade to `editdistance==0.8.1` or newer to ensure correct calculations for all sequence lengths. If unable to upgrade, thoroughly test your application with long sequences on older versions.","message":"Versions prior to `0.8.0` might produce incorrect results for very long sequences (e.g., those with length > 640) due to a bug that was fixed in version `0.8.0`.","severity":"gotcha","affected_versions":"<0.8.0"},{"fix":"Verify wheel availability for your specific Python version. If issues arise, consider creating a custom wheel or installing from a source distribution if build tools are available. Alternatively, constrain your Python version to those with available wheels or use a drop-in Python-only fallback if performance is not critical.","message":"As of November 2023, `editdistance` version 0.8.1 did not have compatible binary wheels for Python 3.13 (cp313), potentially leading to installation failures in strict wheelhouse environments or requiring a build from source, which might have additional dependencies.","severity":"gotcha","affected_versions":"0.8.1 on Python 3.13+"}],"env_vars":null,"last_verified":"2026-04-10T00:00:00.000Z","next_check":"2026-07-09T00:00:00.000Z"}