Skip to main content

khnum 𓎹𓃝

Khnum image

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

Metadata

Release files for khnum 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for khnum 0.0.3
File Size Uploaded
khnum-0.0.3.tar.gz 2.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for khnum 0.0.3
File Interpreter ABI Platform
khnum-0.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 6.9 kB

Release files / khnum-0.0.3.tar.gz

Download URL khnum-0.0.3.tar.gz
Size 2.8 kB
Tags Source
SHA-256 checksum
How to use checksums
b54f6adae6c8a2294b14596db2d3b5303df4088f0a06f8c6fc91460732aab057
BLAKE2b-256 checksum
How to use checksums
8d14d9f5da88972fa8de8f3d7936b2147c59be7bd02b07fc3d2e990263998ed7
Upload date
Uploaded using Trusted Publishing?
What is 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

Release files / khnum-0.0.3-py3-none-any.whl

Download URL khnum-0.0.3-py3-none-any.whl
Size 4.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
70f3a9946b7b396b95d1d93799625c35d341996165f5a8652ec26d0904d0daf2
BLAKE2b-256 checksum
How to use checksums
54f17e78fc8c33a01f289672d0bdadd895a38ba6c7f40bfb3a7ffedca7d36704
Upload date
Uploaded using Trusted Publishing?
What is 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

Release history Release notifications | RSS feed

This release

0.0.3 This release

2 release files

0.0.1

2 release files

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