A professional Python automation tool that dynamically builds nested date-based folder structures (Root/Expense/Statements/YYYY/MM/DD) and performs bulk file uploads to Google Drive using Service Account authentication.
- Dynamic Rooting: Specify the target Google Drive folder via command-line arguments.
- Auto-Hierarchy: Automatically generates a clean
Year/Month/Daystructure. - Bulk Upload: Option to upload all files from a local directory into the final destination.
- Improved Performance: Suppresses discovery cache warnings for cleaner logs.
- Safety & Validation: Automatically strips illegal characters from folder names.
- Professional Logging: Tracks every action in
drive_automation.log.
-
Install Dependencies:
pip install -r requirements.txt
-
Create Hierarchy and Upload Files:
python drive_script.py "YourFolderName" "./Local_Path_To_Files"
-
Get Google API Credentials:
Go to the Google Cloud Console, create a new project, enable the Google Drive API, and under IAM & Admin > Service Accounts, create a key in JSON format. Rename this file to
service_account.jsonand place it in this project folder.