Skip to content

Latest commit

 

History

History
27 lines (20 loc) · 939 Bytes

README.md

File metadata and controls

27 lines (20 loc) · 939 Bytes

GDrive Folder Size Calculator

This is a simple yet only known effective method to calculate google drive folder size using Python. Works for both gdrive file and folder.

Also calculates total number of files and folders inside whole tree

It returns a dict contains name, size, size in bytes, total number of files and total number of folders of the given gdrive file/folder's link/fileID.

The keys in the dict are name, size, bytes, files and folders.

All you need to do is this:

  1. Build a service to pass to the GoogleDriveSizeCalculate class. (Notes to build are given inside the bottom of the script itself.)
  2. Send the fileid or url of your file/folder on Google Drive (File associated with the account you using OR sharable links ONLY)

Output Example:

Name: Channel Zero (2016) Season 1-4 S01-S04 
Size: 38.25GB
Bytes: 41074136619
Files: 24
Folders: 5

If you want only size in bytes:
print(calculate['bytes'])