dicogis.utils.formatters module¶
Helpers to format text and variables.
- dicogis.utils.formatters.convert_octets(octets)¶
Convert a mount of octets in readable size.
- Parameters:
octets (
int
) – mount of octets to convert- Returns:
ko, Mo, etc.
- Return type:
size in a human readable format
Example:
>>> convert_octets(1024) 1 ko >>> from pathlib import Path >>> convert_octets(Path(my_file.txt).stat().st_size)