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 text_to_number

print(text_to_number("duizendnegenhonderddrieënzeventig", "dutch"))    # → "1973"
print(text_to_number("one thousand nine hundred seventy-three", "en")) # → "1973"
print(text_to_number("quatre-vingt-dix", "french"))                    # → "90"

Project details


Download files

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

Source Distribution

polytext2num-0.2.5.tar.gz (24.2 kB view details)

Uploaded Source

Built Distribution

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

polytext2num-0.2.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (284.5 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.17+ x86-64

File details

Details for the file polytext2num-0.2.5.tar.gz.

File metadata

  • Download URL: polytext2num-0.2.5.tar.gz
  • Upload date:
  • Size: 24.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.3

File hashes

Hashes for polytext2num-0.2.5.tar.gz
Algorithm Hash digest
SHA256 709f2732def471e7fb75fcda9ea6aca644bfdaaf4f7250f8f1a7b794b375a970
MD5 8eb6dabbc5da3668f639730b4348f482
BLAKE2b-256 2d0b87053495b316f3e2ecd326c959aff10e179b92e5d4e27f2b1a08af64b5af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for polytext2num-0.2.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 26faa810512edd13b14423f69e577948e5ebee694a2377e41f75c163d10a1510
MD5 51f48d49a738c70e0db6164d400cfc0f
BLAKE2b-256 671a60b4ea1cee6c8b804bcf6b9a18a9e5090115d0ca7156d247dd7712d9925a

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