DESCRIPTION
Project description
Summary
humanreadable is a Python library to convert from human-readable values to Python values.
Supported Unites
time (days, hours, minutes, seconds, …)
bit per seconds
Usage
- Sample Code:
import humanreadable as hr print("\n[Examples: humanreadable.Time]") value = "120 sec" print("'{}' to msecs -> {}".format(value, hr.Time(value).milliseconds)) print("'{}' to minutes -> {}".format(value, hr.Time(value).minutes)) print("\n[Examples: humanreadable.BitPerSecond]") value = "1 Gbps" print("'{}' to Mbps -> {}".format(value, hr.BitPerSecond(value).mega_bps)) print("'{}' to Kbps -> {}".format(value, hr.BitPerSecond(value).kilo_bps)) print("'{}' to Kibps -> {}".format(value, hr.BitPerSecond(value).kibi_bps))
- Output:
[Examples: humanreadable.Time] 120 sec to msecs -> 120000.0 120 sec to minutes -> 2.0 [Examples: humanreadable.BitPerSecond] 1 Gbps to Mbps -> 1000.0 1 Gbps to Kbps -> 1000000.0 1 Gbps to Kibps -> 953674.31640625
Installation
pip install humanreadable
Dependencies
Python 2.7+ or 3.4+
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
humanreadable-0.0.1.tar.gz
(8.7 kB
view hashes)
Built Distribution
Close
Hashes for humanreadable-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f337eb29f7fcbe00ef11a52b4dfc8dd276c5e7c2013aef883e5022d79a906ec7 |
|
MD5 | 4fb66324bd11ac41183fbceea8cb297c |
|
BLAKE2b-256 | a5395b4b87d91cc8b1dd2128f03d10bd8750e120e41ed4b11ba2fc6cfcbaa25d |