humanreadable is a Python library to convert from human-readable values to Python values.
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.2.tar.gz
(8.7 kB
view hashes)
Built Distribution
Close
Hashes for humanreadable-0.0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 54edb2f104952d25b026fbc4fe46eaefbf3e04968c68c5b662f7ed98246f19e4 |
|
MD5 | 1957759e64b13624552b54eb930c2d6d |
|
BLAKE2b-256 | 03fa670ac9906e2e3f52423a9b43d24fdf6e6ca8535b2895822231d55d5e9ad4 |