Skip to content

v0.2.0

Choose a tag to compare

@github-actions github-actions released this 01 May 20:17
· 35 commits to main since this release

words2num2 — inverse of num2words2

Convert spoken-form numbers back to numeric values across 100+
locales. Auto-generated release.

Installation

pip install words2num2

Usage

from words2num2 import words2num, words2num_sentence

words2num("forty-two")                          # 42
words2num("one thousand two hundred")           # 1200
words2num("quarante-deux", lang="fr")           # 42
words2num("zweiundvierzig", lang="de")          # 42
words2num_sentence("I bought twenty-three apples and fourteen pears.")
# 'I bought 23 apples and 14 pears.'

Full Changelog: v0.1.1...v0.2.0