Skip to main content

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

Project description

getsize

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

Install

$ pip install getsize

Usage

$ getsize [OPTION] [FILE]...

Options:
    -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(['README.md'])
790.000 Bytes README.md

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

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

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

Project details


Download files

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

Source Distribution

getsize-1.1.11.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

getsize-1.1.11-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file getsize-1.1.11.tar.gz.

File metadata

  • Download URL: getsize-1.1.11.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for getsize-1.1.11.tar.gz
Algorithm Hash digest
SHA256 bf9452184ad719beb701068068d254f9a2a8b09096a3cd16b3bd2967a74702f7
MD5 cd86056b6c54e5fb6b8e082f3b7a998c
BLAKE2b-256 51d741ff60f46dabe9e1100ac266ab97a2f3cf6f987269e08bd1570c3341ee27

See more details on using hashes here.

File details

Details for the file getsize-1.1.11-py3-none-any.whl.

File metadata

  • Download URL: getsize-1.1.11-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.5

File hashes

Hashes for getsize-1.1.11-py3-none-any.whl
Algorithm Hash digest
SHA256 eb054ffb7166c01f2e46188470614604c8f80c583cf9f04194f6b9d1cf9a47d8
MD5 f724bac4f1c9897b3160f225d44f838b
BLAKE2b-256 899fdbc90c2de85d57dd8c87b28fd2ca4c869be25b1d18a1af374454c44e59b5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page