Human readable numbers
Project description
khnum 𓎹𓃝
the god of human readable numbers
Install
pip install khnum
𓎹𓃝
Usage
import khnum
Examples
>>> khnum.cnum(1234567890)
'1,234,567,890'
>>> khnum.hnum(1234567890)
'1.2B'
>>> khnum.hnum(1234567890, 'bytes')
'1.2GB'
>>> khnum.hnum(1234567890, 'si')
'1.1GiB'
>>> num = khnum.num(1234567890, 'b')
>>> print(num)
{
"_num": 1234567890,
"cnum": "1,234,567,890",
"hnum": "1.2GB",
"type": "<class 'int'>",
"units": "b"
}
Help
$ pydoc khnum
>>> help(khnum)
Test
$ pytest
Contributors
@siznax
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
khnum-0.0.3.tar.gz
(2.8 kB
view details)
Built Distribution
khnum-0.0.3-py3-none-any.whl
(4.1 kB
view details)
File details
Details for the file khnum-0.0.3.tar.gz
.
File metadata
- Download URL: khnum-0.0.3.tar.gz
- Upload date:
- Size: 2.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b54f6adae6c8a2294b14596db2d3b5303df4088f0a06f8c6fc91460732aab057 |
|
MD5 | 737f48067c48204eeb95b0a5ed181f11 |
|
BLAKE2b-256 | 8d14d9f5da88972fa8de8f3d7936b2147c59be7bd02b07fc3d2e990263998ed7 |
File details
Details for the file khnum-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: khnum-0.0.3-py3-none-any.whl
- Upload date:
- Size: 4.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70f3a9946b7b396b95d1d93799625c35d341996165f5a8652ec26d0904d0daf2 |
|
MD5 | 457ec02740fd9dff1aa5f9b05c276db2 |
|
BLAKE2b-256 | 54f17e78fc8c33a01f289672d0bdadd895a38ba6c7f40bfb3a7ffedca7d36704 |