python-Levenshtein: Fast Levenshtein Distance and String Similarity in Python

This repository profile is provided by osrepos.com, an open source repository discovery platform.

python-Levenshtein: Fast Levenshtein Distance and String Similarity in Python

Summary

python-Levenshtein is a Python C extension module designed for high-performance computation of Levenshtein distance and various string similarity metrics. It provides functions for edit distance, string similarity, approximate median strings, and string sequence/set similarity, supporting both normal and Unicode strings. This library is a crucial tool for applications requiring efficient text comparison and analysis.

Repository Information

Analyzed by OSRepos on August 1, 2026

Use at your own risk

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of code from these repositories is the user's own responsibility. Always review the repository, source code, dependencies, licenses, and security implications before running or installing anything. OSRepos is not responsible for issues, damages, or losses resulting from third-party repositories.

Introduction

python-Levenshtein is a powerful Python C extension module that offers highly optimized functions for computing Levenshtein distance and other string similarity metrics. It's designed for speed, making it ideal for applications that require fast text comparison and analysis. The module includes functionalities for:

  • Levenshtein (edit) distance and edit operations
  • String similarity
  • Approximate median strings and string averaging
  • String sequence and set similarity

It fully supports both normal and Unicode strings, and is compatible with Python 2.2 or newer, including Python 3.

Note: The project is currently looking for a new maintainer, as indicated in its README.

Installation

Installing python-Levenshtein is straightforward using pip:

pip install python-Levenshtein

Examples

The module provides a StringMatcher.py class, which is an example of a SequenceMatcher-like class built on top of Levenshtein. While it may miss some of SequenceMatcher's functionality, it also offers extra features. For detailed usage and more examples, it is recommended to refer to the official documentation.

Why Use python-Levenshtein?

The primary advantage of python-Levenshtein lies in its performance. Being a C extension, it offers significantly faster computation of Levenshtein distance and string similarity compared to pure Python implementations. This makes it an invaluable library for:

  • Text Processing: Efficiently comparing and analyzing large volumes of text data.
  • Fuzzy Matching: Implementing robust fuzzy search algorithms.
  • Data Cleaning: Identifying and merging similar, but not identical, entries.
  • Bioinformatics: Applications involving sequence alignment.

Its comprehensive set of functions for various string comparison tasks, combined with its speed, makes it a go-to choice for developers needing high-performance string metrics in Python.

Links

Related repositories

Similar repositories that may be relevant next.

fake2db: Generate Custom Test Databases with Fake Data

fake2db: Generate Custom Test Databases with Fake Data

August 2, 2026

fake2db is a powerful Python utility designed to create custom test databases populated with fake, yet valid, data. It supports a wide array of popular database systems, including SQLite, MySQL, PostgreSQL, MongoDB, Redis, and CouchDB. This tool is ideal for developers and testers needing quick, realistic data for testing and development environments.

PythonDatabaseFake Data
Mimesis: A Powerful Python Library for Realistic Fake Data Generation

Mimesis: A Powerful Python Library for Realistic Fake Data Generation

August 2, 2026

Mimesis is a robust Python library designed for generating fake yet realistic data across various languages and locales. It simplifies the creation of diverse data types, from personal information to financial details. This makes it an invaluable tool for development, testing, and anonymization tasks.

Pythondata generationfake data
chardet: A Fast and Accurate Python Character Encoding Detector

chardet: A Fast and Accurate Python Character Encoding Detector

August 2, 2026

chardet is a powerful Python library designed for universal character encoding detection. The recently rewritten version 7 offers significant improvements in accuracy and speed, making it a robust solution for identifying text encodings. It provides features like language and MIME type detection, along with a flexible API for various use cases.

Pythoncharacter encodingencoding detection
Fuzzywuzzy: Python Library for Fuzzy String Matching

Fuzzywuzzy: Python Library for Fuzzy String Matching

August 1, 2026

Fuzzywuzzy is a popular Python library designed for fuzzy string matching, enabling efficient comparison and similarity scoring between text strings. It leverages Levenshtein distance to help with tasks like data cleaning and record linkage. While widely used, this project has been superseded by TheFuzz, which continues its development under a new name.

PythonFuzzy MatchingString Comparison

Source repository

Open the original repository on GitHub.

View on GitHub
OS
OSRepos

Analysis and discovery of open source repositories. Find interesting projects and follow their updates.

Monitor your website with YourWebsiteScore

OSRepos shares public repositories for knowledge and discovery only. Any installation, execution, configuration, or use of third-party repository code is at your own risk. Always review source code, dependencies, licenses, and security implications before running anything.

© 2025 OSRepos. Built with Nuxt 3 and lots of ❤️