Skip to main content

A small library to convert text numbers to digits in a string

Project description


Python 3 only!

from t2d import Text2Digits
Text2Digits().convert("I was born in nineteen ninety two and am twenty six years old!")


"i was born in 1992 and am 26 years old!"

I find this useful if using Alexa/Lex to convert audio to text and have to convert the text to digits.


  • Still need to add support for decimal numbers
  • Need to add support for negative numbers


I have heavily used code from the SO answers from here: and improved upon them

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

text2digits-careless25-0.0.2.tar.gz (3.4 kB view hashes)

Uploaded source

Built Distribution

Supported by

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