Skip to content

Port conversion engine to Rust; Python becomes a thin binder#122

Merged
jqueguiner merged 1 commit into
mainfrom
rust-port-binder
Jul 17, 2026
Merged

Port conversion engine to Rust; Python becomes a thin binder#122
jqueguiner merged 1 commit into
mainfrom
rust-port-binder

Conversation

@jqueguiner

Copy link
Copy Markdown
Owner

Replaces the pure-Python converters with a compiled Rust core (PyO3/abi3); the Python package is now a thin binder. Output is byte-for-byte identical to the previous pure-Python library (frozen ~150k-case corpus). Adds a maturin multi-platform release workflow (slim wheels to PyPI, full wheels to GitHub Releases) and adopts upstream PRs savoirfairelinux#657/savoirfairelinux#660/savoirfairelinux#661/savoirfairelinux#662/savoirfairelinux#666/savoirfairelinux#668/savoirfairelinux#670. See README + FINDINGS.

Replace the pure-Python converters with a compiled Rust core (num2words2-core
via PyO3/abi3); the Python package is now a thin binder that normalises
arguments and shapes results. Output is byte-for-byte identical to the previous
pure-Python library, validated against a frozen ~150k-case corpus.

- Delete the 156 lang_*.py modules + base/currency/converters; keep the binder
  __init__.py, grouping.py and _version.py.
- Vendor the Rust crate under rust/ (num2words2-core + num2words2-py, lib _rust).
- Switch the build to maturin (single mixed Rust/Python wheel).
- Add a maturin multi-platform release workflow: slim wheels -> PyPI, full
  wheels (embedded lingua-rs language-detection models) -> GitHub Releases.
- Adopt upstream PRs savoirfairelinux#657 (Latin declension), savoirfairelinux#660 (Polish typos),
  savoirfairelinux#661/savoirfairelinux#666/savoirfairelinux#668/savoirfairelinux#670 (ordinal fixes) and savoirfairelinux#662 (Hindi 10^41 scale).
- README: reframe as a Rust port with a Python binder; add a performance section.
@jqueguiner
jqueguiner merged commit b1d688b into main Jul 17, 2026
22 of 34 checks passed
@jqueguiner
jqueguiner deleted the rust-port-binder branch July 17, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant