qgis_deployment_toolbelt.utils.formatters module¶
Helpers to format text and variables.
- qgis_deployment_toolbelt.utils.formatters.convert_octets(octets: int) str ¶
Convert a mount of octets in readable size.
- Parameters:
octets – 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)