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
Release files for numify 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| numify-1.0.1.tar.gz | 3.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| numify-1.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.0 kB
Release files / numify-1.0.1.tar.gz
| Download URL | numify-1.0.1.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6ca1ea7a49426c833f1d99c24e1273330115fb766d44bbb23464ce720186c481
|
|
BLAKE2b-256 checksum How to use checksums |
778eebcb6feb5b7d60ef561b3ff3b2640b122f3ed64e8978a25cc450174a143c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / numify-1.0.1-py3-none-any.whl
| Download URL | numify-1.0.1-py3-none-any.whl |
|---|---|
| Size | 4.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c52e64b515c0999816c2a76c3824f88bf4e4f99e787255287166169503ccdc09
|
|
BLAKE2b-256 checksum How to use checksums |
5ed6839cb49c01d53086e282e204b0517f7d33af374e07dca9acf9b4b205a294
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|