Skip to main content

Get and display the size of file and directory with binary prefixes

Project description


Get and display the size of file and directory with binary prefixes


$ pip install getsize


$ getsize [OPTION] [FILE]...

    -h - Show this help
    -v - Show version information
    -b - Bytes
    -k - KiB
    -m - MiB
    -g - GiB
    -t - TiB
    -p - PiB
    -e - EiB
    -z - ZiB
    -y - YiB

Use as a module

In [1]: import getsize

In [2]: gs = getsize.GetSize()

In [3]: gs.convSize(4096)
Out[3]: (4.0, 'KiB')

In [4]: gs.convSize(4096, 'KiB')
Out[4]: (4.0, 'KiB')

In [5]: gs.getSize([''])
790.000 Bytes

In [6]: gs.getSize([''], 'KiB')
0.771 KiB

In [7]: fs = gs.getArgSize('')

In [8]: for file, size in fs:
   ...:     print(file, size)
   ...: 790

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for getsize, version 1.1.11
Filename, size File type Python version Upload date Hashes
Filename, size getsize-1.1.11.tar.gz (3.1 kB) File type Source Python version None Upload date Hashes View
Filename, size getsize-1.1.11-py3-none-any.whl (4.1 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page