Skip to main content

Convert written-out numbers to digits in multiple languages using a fast Rust + Python binding.

Project description

text2num-py

Convert written out numbers (e.g. "duizendnegenhonderddrieënzeventig") into digits (1973) using a fast Rust + Python binding.

Based on: https://github.com/allo-media/text2num-rs

Works for the following languages:

  • Dutch ("nl")
  • English ("en")
  • French ("fr")
  • Spanish ("es")
  • German ("de")
  • Italian ("it)

Installation

pip install polytext2num

Usage

from polytext2num import text2num

print(text2num("duizendnegenhonderddrieënzeventig", "dutch"))    
# "1973"

print(text2num("one thousand nine hundred seventy-three", "en")) 
# "1973"

print(text2num("quatre-vingt-dix", "french")) 
# "90"

print(text2num("I have two apples and one banana, twenty kegs.", "en", threshold = 10)) 
# "I have two apples and one banana, 20 kegs."

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

polytext2num-0.2.23-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (345.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

polytext2num-0.2.23-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (346.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

polytext2num-0.2.23-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (346.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.17+ x86-64

polytext2num-0.2.23-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (346.5 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

polytext2num-0.2.23-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (346.2 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

polytext2num-0.2.23-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (346.1 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

File details

Details for the file polytext2num-0.2.23-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for polytext2num-0.2.23-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 349d6323a1b50b3e85bfaced587d5d4f04626fac93de5fb061a92b2900c83fdf
MD5 87296e869ce884f55687162f52830d66
BLAKE2b-256 0475edf2bb510264384b8da72bf358bc4790c2b1d3e28c9bda8f612d1366e9f7

See more details on using hashes here.

File details

Details for the file polytext2num-0.2.23-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for polytext2num-0.2.23-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c4dfdd9bdb960c34065573e3a069cd5b8e6c4ca3f055743fff170c78262c219b
MD5 1e358d6e195c8753f3856f326d5b2213
BLAKE2b-256 3f64748cc81b7498a26827839374d5fdebc7e0ca3a765d92b3a0c28c9c6e9a90

See more details on using hashes here.

File details

Details for the file polytext2num-0.2.23-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for polytext2num-0.2.23-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d137b40d8aaf263af0727ac0e99b0b510bda6af68bd3544c554ad48e70f50c1f
MD5 9b65b66f10c5a007ab79f543d52f1d00
BLAKE2b-256 49e5831846c07a1cc5ed2aa822e25439f04f30f0e1187ca5f211a7d413096c52

See more details on using hashes here.

File details

Details for the file polytext2num-0.2.23-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for polytext2num-0.2.23-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8e16703a7a4d6fd59ed7d8187074a0e032bf2ee3f3d8eae6df797ac796e7605e
MD5 a6aca8b6c6aa3b6c11000277e8851b39
BLAKE2b-256 0c1f4acd937fbfb39f79ca3b73e96347cd6092fe4f5e680e48cc50c08e3a8d15

See more details on using hashes here.

File details

Details for the file polytext2num-0.2.23-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for polytext2num-0.2.23-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 47de5867c5ded31609d5d5677adc47eed3552d5a64f4abc168fc45f943a58db0
MD5 768c87cc2515aad5cc135140f400bf20
BLAKE2b-256 b171688ecfa670f3bf6ca5e33b69f86fd01e66df8a1d4d3da02863114fc1150f

See more details on using hashes here.

File details

Details for the file polytext2num-0.2.23-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for polytext2num-0.2.23-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 eb2cc2e780882743762c9dcdcbca485bf8e6c1b865ee0612698465aa18f6d266
MD5 56a20381a17710d63dfc0a45f4bf7cce
BLAKE2b-256 d7435311773046ad7a27eb77bcff80a8cb7f0a6cb1fc135db325a1cb50e8bb65

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page