Fast Unicode spelling correction and word segmentation for Python. SymSpellCppPy uses the Symmetric Delete algorithm in C++20 and exposes it through nanobind.
python -m pip install SymSpellCppPyThe project targets CPython 3.10–3.15. The release workflow builds wheels for Linux x86-64 and arm64, Windows x64, and macOS Intel and Apple Silicon. Source builds require CMake 3.26 or newer and a C++20 compiler.
from SymSpellCppPy import SymSpell, Verbosity
spell = SymSpell(max_dictionary_edit_distance=1)
spell.create_dictionary_entry("damen", 42)
spell.create_dictionary_entry("receive", 100)
suggestion, = spell.lookup("dämen", Verbosity.TOP)
print(suggestion.term, suggestion.distance) # damen 1
suggestion, = spell.lookup("Recieve", Verbosity.TOP, transfer_casing=True)
print(suggestion.term) # ReceiveThe package includes English unigram and bigram dictionaries. The runnable quickstart shows how to load them and use word lookup, compound correction, and segmentation. See the usage guides and API reference for custom dictionaries, Unicode, and binary snapshots.
The compatibility guide tracks the C# reference through SymSpell 6.7.3. It covers the 6.7 segmentation changes, the 6.7.1 dictionary update, and remaining differences with the reference and symspellpy.
python -m pip install -e '.[test,docs]'
python -m pytest
python -m sphinx -W -b html docs/source build/docs
python -m sphinx -W -b doctest docs/source build/doctestNative tests use Catch2 and CTest.
cmake -S . -B build/native -DBUILD_FOR_TEST=ON -DCMAKE_BUILD_TYPE=Release
cmake --build build/native --config Release
ctest --test-dir build/native -C Release --output-on-failureSet the release version in pyproject.toml. The installed package exposes the same version as SymSpellCppPy.__version__.
- Push a matching tag such as
v0.1.0to build and test the wheels and source distribution. GitHub Actions stores them as artifacts for review. - Publish a GitHub release from that tag. The release run rebuilds and tests the distributions, then uploads them to PyPI.
See benchmark results and reproduction commands for the comparison with symspellpy and native symspell_rs. Run python benchmark.py to measure the installed extension. The benchmark extra adds symspellpy with the optional editdistpy accelerator.