earthkit.data.utils.humanize

Attributes

Functions

as_bytes(value[, name, none_ok])

as_number(value, name, units, none_ok)

as_percent(value[, name, none_ok])

as_seconds(value[, name, none_ok])

as_timedelta(value[, name, none_ok])

base2(n)

Return a human readable string for a number, using base 2 units.

bytes(n)

Convert a number of bytes into a human readable string, using base 2 units.

dict_to_human(query)

did_you_mean(word, vocabulary)

interval_to_human(v[, value])

list_to_human(lst[, conjunction])

number(value)

plural(value, what)

rounded_datetime(d)

seconds(seconds)

string_distance(s, t)

when(then[, now, short])

Module Contents

earthkit.data.utils.humanize.DOW = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
earthkit.data.utils.humanize.MONTH = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September',...
earthkit.data.utils.humanize.PERIODS
earthkit.data.utils.humanize.as_bytes(value, name=None, none_ok=False)
earthkit.data.utils.humanize.as_number(value, name, units, none_ok)
earthkit.data.utils.humanize.as_percent(value, name=None, none_ok=False)
earthkit.data.utils.humanize.as_seconds(value, name=None, none_ok=False)
earthkit.data.utils.humanize.as_timedelta(value, name=None, none_ok=False)
earthkit.data.utils.humanize.base2(n)

Return a human readable string for a number, using base 2 units.

>>> base2(4096)
'4K'
>>> base2(4000)
'3.9K'
earthkit.data.utils.humanize.bytes(n)

Convert a number of bytes into a human readable string, using base 2 units.

>>> bytes(4096)
'4 KiB'
>>> bytes(4000)
'3.9 KiB'
earthkit.data.utils.humanize.dict_to_human(query)
earthkit.data.utils.humanize.did_you_mean(word, vocabulary)
earthkit.data.utils.humanize.interval_to_human(v, value='x')
earthkit.data.utils.humanize.list_to_human(lst, conjunction='and')
earthkit.data.utils.humanize.number(value)
earthkit.data.utils.humanize.plural(value, what)
earthkit.data.utils.humanize.rounded_datetime(d)
earthkit.data.utils.humanize.seconds(seconds)
earthkit.data.utils.humanize.string_distance(s, t)
earthkit.data.utils.humanize.when(then, now=None, short=True)