human_file_size#

astropy.utils.console.human_file_size(size)[source]#

Returns a human-friendly string representing a file size that is 2-4 characters long.

For example, depending on the number of bytes given, can be one of:

256b
64k
1.1G
Parameters:
sizeint

The size of the file (in bytes)

Returns:
sizestr

A human-friendly representation of the size of the file