A terminal-based Python application that lets you upload files from your local machine to your Google Drive account. Built using the Google Drive API and OAuth 2.0 for authentication.
- Upload any file to your Google Drive using the terminal
- Secure authentication with OAuth2
- Saves token for future use (no need to log in every time)
- Perfect for simple backups or automation
Make sure you have the following installed:
- Python 3.7+
- pip
-
Clone or download this repository to your system: git clone https://github.com/your-username/google-drive-uploader.git cd google-drive-uploader
-
Install the required modules: pip install -r requirements.txt
You must provide a client_secret.json file:
- Go to the Google Cloud Console.
- Create a project (or use an existing one).
- Go to APIs & Services > Credentials.
- Click Create Credentials > OAuth Client ID.
- Select Desktop App, then download the client_secret.json.
- Place it in the same folder as main.py.
If you're not the developer (e.g. you're a coursemate), ask the developer to add your Gmail to the test users list under the OAuth Consent Screen.
-
Run the program: python main.py
-
Add the file you want to upload in the upload folder.
3.The app will:
- Ask you to log into your Google account the first time (opens in browser).
- Create a token file (token.pickle) for future uploads.
- Ask for the file path of what you want to upload.
- Upload it to your Google Drive root folder.
- Done! The terminal will confirm the upload and show you the file name.
- If you're using this for the first time:
- You'll be redirected to your browser for Google login.
- Make sure your Gmail is approved as a test user by the developer.
- A token.pickle file will be generated automatically for reuse.
- If your token.pickle gets deleted, you'll need to log in again.
- This project uses the drive.file scope, meaning it can only see/edit files created by this app.
- Do not rename client_secret.json unless you also change the name in main.py.
Developed by Daniel Iyendo with help from, with love from Sail Campus and a starting project from Master David🧠✨ Uses the Google Drive API.
This project is licensed for educational and personal use. You may fork or modify it freely for learning purposes.
Made by Iyendo Daniel Okeoghene