Skip to content

About

A small Python utility to upload a local file to Google Drive.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

GDRIVE Uploader

A small Python utility to upload a local file to Google Drive. The script checks whether the target folder exists and creates it if needed, then uploads or overwrites the specified file.

Features

  • Upload a local file to a Google Drive folder
  • Automatically create the target folder if it does not exist
  • Reuse existing file on Drive and overwrite it if found
  • Load upload settings from config.json

Requirements

  • Python 3.8+
  • PyDrive
  • Google Drive API credentials

Setup

  1. Install dependencies:
pip install pydrive
  1. Create a Google API project and enable the Google Drive API.
  2. Download the OAuth client secrets file and save it as client_secrets.json in the repository root.
  3. Create credentials.json using PyDrive authentication or copy it from an existing authenticated session.
  4. Copy config.example.json to config.json and update the values:
{
  "remote_file_name": "desired_remote_file_name.txt",
  "remote_folder_name": "desired_remote_folder_name",
  "local_file_name": "local_file_to_be_loaded.txt"
}

Usage

Run the uploader script from the repository root:

python Gdrive_uploader.py

Notes

  • Do not commit client_secrets.json, credentials.json, or config.json to a public repository.
  • The script currently expects credentials.json to exist before running.
  • If multiple files or folders have the same name on Drive, the script uses the first match found.

About

A small Python utility to upload a local file to Google Drive.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages