Skip to content

Installation

Install prebuilt strsimpy wheels or build the Rust extension from source.

The package is published on PyPI as strsimpy. Prebuilt wheels are the recommended option for most users; build from source only when your platform has no compatible wheel or you are developing the library itself.

Install from PyPI

pip install -U strsimpy

This is the recommended path. It installs a prebuilt extension module on supported platforms and needs no Rust toolchain.

Requirements

Scenario Requirements
Prebuilt wheel Python 3.10-3.13. No Rust toolchain required.
Source distribution Python 3.10-3.13, Rust 1.85 or newer and a C compiler.
Editable development install The source requirements, plus a Git checkout.

The project tests Python 3.10, 3.11, 3.12 and 3.13 in CI.

Prebuilt wheels

The published wheels are abi3 wheels built for CPython 3.10 and newer, so a single wheel works across the supported Python versions.

Platform Architectures Notes
Linux x86_64, aarch64 manylinux (glibc) and musllinux (Alpine)
macOS x86_64, arm64 Intel and Apple silicon
Windows x64

Build from source

If no compatible wheel is available, pip builds from the source distribution automatically. To force a source build:

pip install --no-binary strsimpy strsimpy

Source builds require a Rust toolchain 1.85 or newer and a C compiler. maturin is declared as the build backend in pyproject.toml, so pip installs it in its isolated build environment when needed.

Editable development install

For work on the library itself, clone the repository and install it in editable mode:

git clone https://github.com/luozhouyang/python-string-similarity.git
cd python-string-similarity
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -U pip
pip install -e .

pip install -e . uses maturin to build the extension and install it into the active environment. When you are iterating on Rust code, maturin develop --release rebuilds and reinstalls the extension in place.

Verify the install

python -c "import strsimpy; print(strsimpy.__version__)"

The current release prints:

0.5.0

Python API compatibility

The Python API is unchanged from the pure-Python versions. Version 0.4.0 moved the implementations to Rust, but imports, class names, constructor options and method names stayed the same.

from strsimpy import Levenshtein, JaroWinkler

from strsimpy.levenshtein import Levenshtein as ModuleLevenshtein

Both import paths resolve to the same classes, so existing code and the per-module imports used in older examples continue to work.

Type to search…

↑↓ navigate↵ selectEsc close