High-performance Python string utilities powered by nanobind.
Built with the modern 2025/2026 C++ toolchain:
uv— Rust-powered Python project/dependency managerscikit-build-core— PEP 517/660 build backend for CMake projectsnanobind— lightweight C++17 binding library (sub-30ns invocation, ~10x smaller binaries vs pybind11)cibuildwheel— multi-platform wheel generation in CI
string-utils/
├── CMakeLists.txt
├── pyproject.toml
├── python/string_utils/
│ ├── __init__.py
│ ├── _core.pyi
│ └── py.typed
├── src/
│ ├── bindings.cpp
│ ├── string_ops.cpp
│ └── string_ops.hpp
└── tests/
└── test_string_utils.py
uv sync --extra test
uv run pytest
uv run python -c "
import string_utils
print(string_utils.word_count('Fast native Python extensions using nanobind and uv.'))
print(string_utils.reverse('nanobind'))
"The distribution is named
string-utils, but it is imported asstring_utils(Python replaces hyphens with underscores for import names).
The string operations work on individual bytes and are only fully correct for ASCII input. Multi-byte UTF-8 text (e.g. accented characters) is not reversed or case-folded as logical characters.