Skip to main content

Build Status

numerizer

A Python module to convert natural language numerics into ints and floats. This is a port of the Ruby gem numerizer

Installation

The NLG library can be installed from PyPI as follows:

$ pip install numerizer

or from source as follows:

$ git clone https://github.com/jaidevd/numerizer.git
$ cd numerizer
$ pip install -e .

Usage

>>> from numerizer import numerize
>>> numerize('forty two')
'42'
>>> numerize('forty-two')
'42'
>>> numerize('four hundred and sixty two')
'462'
>>> numerize('one fifty')
'150'
>>> numerize('twelve hundred')
'1200'
>>> numerize('twenty one thousand four hundred and seventy three')
'21473'
>>> numerize('one million two hundred and fifty thousand and seven')
'1250007'
>>> numerize('one billion and one')
'1000000001'
>>> numerize('nine and three quarters')
'9.75'
>>> numerize('platform nine and three quarters')
'platform 9.75'

Download files

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

Source Distribution

numerizer-0.1.5.tar.gz (4.6 kB view details)

Uploaded Source

File details

Details for the file numerizer-0.1.5.tar.gz.

File metadata

  • Download URL: numerizer-0.1.5.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.6.8

File hashes

Hashes for numerizer-0.1.5.tar.gz
Algorithm Hash digest
SHA256 f50ec94fe1339dad5c58e77123a48a3a9d5b75a3d013f9402de82fe5b3f11ab6
MD5 496de7f4d1a4bf26c648c935a2c5aa65
BLAKE2b-256 2b564ad7a4ca2323c957d74516c855380e66101049a17bd6a4f77429542d03c3

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.4

2 files

0.2.3

1 file

0.2.2

1 file

0.2.1

1 file

0.2.0

1 file

0.1.6

1 file

This release

0.1.5 This release

1 file

0.1.4

1 file

0.1.3

1 file

0.1.2

1 file

0.1.1

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page