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.2.tar.gz (24.3 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.2-cp311-cp311-manylinux_2_34_x86_64.whl (284.7 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

File details

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

File metadata

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

File hashes

Hashes for polytext2num-0.2.2.tar.gz
Algorithm Hash digest
SHA256 74d470e3a66f663c84b392469d6233a8c30e359b4811616ff6b7751502ac4a96
MD5 db3c3d5ae2062f7ddede6b9479c217c0
BLAKE2b-256 894be5e99138f95d0b5bd9a28f46eeaf9854059807a7dfe4301cc4b77273601c

See more details on using hashes here.

File details

Details for the file polytext2num-0.2.2-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for polytext2num-0.2.2-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 1f133ec4c76b62c81cef6ea384285c62e3979ab3c33872584477ce03a5447d71
MD5 9479f8d112684a587eacb71a66ba826b
BLAKE2b-256 9066602e25572abd3e4eaa1cdd2c727e6187a4d333f981259fbd3b03f9f12966

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