Skip to main content

Convert alphanumeric characters to integers i.e 1k to 1000

Project description

Numify

Numify is a Python (2 and 3) library for converting alphanumeric characters into integers.

Numify is the opposite of Numerize (another python library, that can be found here).

Installation

You can install the Numify from PyPI:

$ pip install numify

The library is supported on Python 2.7, as well as Python 3.4 and above.

How to use

numify(alphanumeric_to_numify)

>>> from numify import numify
>>> numify.numify('12K')
12000
>>> numify.numify('15   k')
15000

This will convert the alphanumeric string '15 k' into an integer like 15000 (ignoring the spaces between).

Example

Command Output
numify("1K") 1000
numify("1k") 1000
numify("1 K") 1000
numify("1.5K) 1500
numify("1M) 1000000
numify("1.5m) 1500000
numify("1B) 1000000000
numify("1.5b) 1500000000
numify("1T) 1000000000000

Testing

$ python numify/numify_test.py

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

numify-1.0.1.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

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

numify-1.0.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file numify-1.0.1.tar.gz.

File metadata

  • Download URL: numify-1.0.1.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.0

File hashes

Hashes for numify-1.0.1.tar.gz
Algorithm Hash digest
SHA256 6ca1ea7a49426c833f1d99c24e1273330115fb766d44bbb23464ce720186c481
MD5 e4dbebb742bb50121081fd6566505a85
BLAKE2b-256 778eebcb6feb5b7d60ef561b3ff3b2640b122f3ed64e8978a25cc450174a143c

See more details on using hashes here.

File details

Details for the file numify-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: numify-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.0

File hashes

Hashes for numify-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c52e64b515c0999816c2a76c3824f88bf4e4f99e787255287166169503ccdc09
MD5 3d0cfa17a87cae37e64245c3b1298d67
BLAKE2b-256 5ed6839cb49c01d53086e282e204b0517f7d33af374e07dca9acf9b4b205a294

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