Repository navigation
Development and Contributing
Development happens at:
https://github.com/jqueguiner/num2words2
Open issues and pull requests against jqueguiner/num2words2.
git clone https://github.com/jqueguiner/num2words2.git
cd num2words2
python -m pip install -e .
python -m pip install -r requirements-test.txtThe Makefile provides common workflows:
make help
make dev-install
make test
make test-coverage
make lint
make formatRun the standard test suite:
make testRun tox across configured Python versions:
toxRun a quick stop-on-first-failure pass:
make test-quickTypical steps:
- Add a
num2words2/lang_XX.pyconverter. - Register it in
CONVERTER_CLASSESinnum2words2/__init__.py. - Add tests under
tests/lang/test_xx.py. - Verify cardinal behavior first, then ordinals, currency, years, and special options as applicable.
- Run focused tests, then the full suite.
Keep behavior compatible with existing converter conventions. Raise NotImplementedError when a mode or currency code is not implemented.
Currency behavior is language-sensitive. Update the converter's CURRENCY_FORMS or language-specific currency methods, then add tests for:
- singular and plural major units
- zero, one, and multiple subunits
- negative values
- fractional cents or 3-decimal currencies if relevant
- unsupported currency codes
Before opening a PR:
- The branch merges cleanly.
- Unit tests pass.
- New behavior has focused tests.
- Formatting and import ordering match the project tooling.
- User-facing changes are reflected in README,
REFERENCE.md, or the wiki when relevant.
The Makefile includes release-oriented targets:
make clean
make build
make check-build
make release-checkOnly run release commands when preparing an actual package release.
Documentation for jqueguiner/num2words2. Licensed under LGPL-2.1.