pyufunc.human_file_size#

pyufunc.human_file_size(value, *, binary=False, gnu=False, format_str='%.1f')#

Format a byte count as a human-readable file size.

Parameters:
  • value – Byte count.

  • binary – If True, use binary prefixes.

  • gnu – If True, use GNU-style prefixes.

  • format_str – Numeric format string used by humanize.

Note

Example

>>> human_file_size(1536)
'1.5 kB'
Returns:

Human-readable file size.

Return type:

str