This Python script allows for bulk uploading of files from a specified local directory to a Google Drive folder. It handles authentication, supports large files by uploading in chunks, and provides a real-time progress bar for each file upload.
- Google Drive API enabled in your Google Cloud project.
credentials.json
from the Google Developer Console for OAuth2 authentication.- Python libraries:
google-auth-oauthlib
,google-api-python-client
,tqdm
.
- Place your
credentials.json
file in the same directory as the script. - Install required libraries:
pip install google-auth-oauthlib google-api-python-client tqdm
- Run the script once to authenticate and save the authentication token:
python UploadFiles.py
- Modify
folder_id
in the script with the ID of the target Google Drive folder. - Change
source_folder
to the path of your local directory containing the files to upload. - Re-run the script to start uploading files.
- Bulk uploads files from a specified directory.
- Handles large files with chunked uploads.
- Displays upload progress with a real-time progress bar.
- If modifying the OAuth scopes, delete
token.pickle
to re-authenticate. - Ensure your Google Drive API and billing are properly set up in the Google Cloud Console.
StreamBit