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 txt2num

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

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

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

print(txt2num("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.24-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.24-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.24-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.24-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.24-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (346.1 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.17+ x86-64

polytext2num-0.2.24-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.24-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for polytext2num-0.2.24-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 81bf842fd34cfd8351b9bed22c536a9ef8d34ab33cbe9773707d49ca53a04f0f
MD5 bd6f92a0df65c3daa9c3aab21df1ed46
BLAKE2b-256 c7435bf4bcecce719805d6649fe09dbd9532d4d62641b117e25219c2c3457ff4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polytext2num-0.2.24-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3c35c8789ac3ce29a906de3eaa5d354518a2991e567470d42db1d8e2c04a1a40
MD5 c9fdb825f912f944f056d31ca4a884a2
BLAKE2b-256 74d6a9a3d43cdf3aa4fa401471922ddbb90c7a8905ea0a253871900446c27019

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polytext2num-0.2.24-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c0e8b81420f129cd371474812edc82027610ac99a2ff0ee174ecbb45b3978c64
MD5 817ee6c0a0b91b0a745bf9ce600fedc2
BLAKE2b-256 1716f900593506d2ded2eedc276f6d5387e73a9879db2f1fb1be7c57cd5ac741

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polytext2num-0.2.24-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 42a3b10569baf1e02447fb2e64b29c85a6868ea787f4e4cbb78d9be02b3b88e3
MD5 24fa42c50685db50012be2931ee288b9
BLAKE2b-256 75352bf005e7d6a3c2f5a317446b9472b500958fb1fe0c90f693e186e2f788de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polytext2num-0.2.24-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3d6571ca2ecda531e0aa8cef767c02ebef1c06777db8ee20e711c5fdd4a6cb9a
MD5 087336f030f95f9183449fecc958f894
BLAKE2b-256 19d9c4ef3b0eb54de74b05fb25238acbb3ac560771b7a24003f5aa18842f3437

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polytext2num-0.2.24-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ae6ce3bf24c2dc862f7cbcf5ca6cfc012d95dad0cfd8a27be17f74ae260b5bdf
MD5 a2742ce1e9d0544a6620f1596bc63b9c
BLAKE2b-256 1f613608cda6273c69ff84730f79b6a42f312ac5010d08eb3ba5ee519be9625e

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