risc.utils
Define the RISC utilities.
get_user_agent
get_user_agent(user_agent: str = 'risc-python')
Get the current module version.
roundup
roundup(x: float)
Round the provided float up to the nearest tens.
determine_bytes
determine_bytes(size: float)
Determine the highest denomination from bytes to KB, MB, GB, and TB.
Args: size (int): The size, in bytes.
Returns: dict: The dictionary mapping of highest bytes denomination and the equivalent size.
format_bytes
format_bytes(size: float, denomination: str = 'GB')
Convert bytes to the desired denomination.
Args: size (int): The size, in bytes. denomination (str): The byte denomination to convert size to. Defaults to: GB. Options are: KB, MB, GB, and TB.
Returns: float: The float formatted to the requested denomination.
handle_disk_sizing
handle_disk_sizing(total_size: str,
free_size: str,
fudge_factor: float = 1.5)
Determine disk sizing based on the provided fudge factor and utilized space.