Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/XtremeRahul/gdrive_folder_size
A simple script to calculate gDrive folder size, and total number of files and folders in it using python❤️
https://github.com/XtremeRahul/gdrive_folder_size
gdrive gdrive-folder python size-calculation
Last synced: 23 days ago
JSON representation
A simple script to calculate gDrive folder size, and total number of files and folders in it using python❤️
- Host: GitHub
- URL: https://github.com/XtremeRahul/gdrive_folder_size
- Owner: XtremeRahul
- Created: 2020-08-29T15:19:09.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-04-05T18:56:41.000Z (over 1 year ago)
- Last Synced: 2024-08-09T13:15:41.446Z (4 months ago)
- Topics: gdrive, gdrive-folder, python, size-calculation
- Language: Python
- Homepage: http://telegram.me/XtremeProjects
- Size: 55.7 KB
- Stars: 52
- Watchers: 4
- Forks: 36
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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. Uses Drive Api v3. It is scripted to be usable on terminal, the major application of this script is that you can use it on your gDrive projects by simply modifying it to your needs.## Also calculates total number of files and folders inside whole tree
It returns a dict contains name, size, size in bytes, type, 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, type, files and folders.
## All you need to do is this:
1) ```pip3 install -r requirements.txt```
2) Create a **`service`** variable and pass it to the GoogleDriveSizeCalculate class. Notes to create it are given inside the bottom of the script. There you can either use a credentials.json or a service account to auth the service.
3) ```python3 gdrive_calculator.py```
4) On the terminal, Input the url/fileid of your file/folder in Google Drive (Files associated with your account OR public shareable links Only)## Output Example:
```
Name: Smallville (2001-) Season 1-4 S01-S04
Size: 38.25GB
Type: Folder
Bytes: 41074136619
Files: 24
Folders: 5If you want only size in bytes:
print(calculate['bytes'])
```