client.units ============ .. py:module:: client.units Classes ------- .. autoapisummary:: client.units.TimeUnit client.units.MemUnit Module Contents --------------- .. py:class:: TimeUnit(sec: int = 0, min: float = 0.0, hour: float = 0.0) A helper class provides static functions to switch among seconds, minutes, and hours. It also can be initialized with combined input of seconds, minutes, and hours, and converts them to any single time unit. The constructor. .. py:method:: min_to_sec(minutes: float) -> int :staticmethod: Static helper function to turn minutes into seconds. Accept pointers. .. py:method:: hour_to_sec(hour: float) -> int :staticmethod: Static helper function to turn minutes into seconds. .. py:method:: hour_to_min(hour: float) -> float :staticmethod: Static helper function to turn minutes into seconds. .. py:method:: min_to_hour(min: float) -> float :staticmethod: Static helper function to turn minutes into seconds. .. py:method:: sec_to_hour(sec: int) -> float :staticmethod: Static helper function to turn minutes into seconds. .. py:method:: sec_to_min(sec: int) -> float :staticmethod: Static helper function to turn minutes into seconds. .. py:attribute:: seconds :value: 0 .. py:attribute:: minutes .. py:attribute:: hours .. py:attribute:: readable :value: '' .. py:class:: MemUnit A helper class to convert memory units between B, k, K, m, M, g, G, t, T. .. py:attribute:: base_chart_to_B .. py:method:: convert(input: str, to: str = 'M') -> int :staticmethod: Convert memory to different units. input: a string in format "1G", "1g", "1Gib", "1gb",etc. to: the unit to convert to; takes B, K, M, G, T. Lower case unit will be treated as capital. Return: an int of the memory value of your specified unit