Skip to main content

Google Drive CLI Uploader

Project description

gupload - Google Drive CLI Uploader

Travis Release License PyPI

Our motivation to create the gupload tool was the deployment of the GitLab CI artifacts to our Google Drive disk. The tool is not limited to this use-case though. It is a simple Python 3 command-line utility ingesting file names and their respective path arguments. Those are uploaded to Google Drive via Google service account (recommended approach by Google) and an optionally specified folder (through its ID).

The secret file is accessed via the environmental variable GOOGLE_APPLICATION_CREDENTIALS and it should be set prior the program execution:

$ export GOOGLE_APPLICATION_CREDENTIALS=/path/to/credentials.json


  • Python 3 + PIP
  • Enabled Google Drive API (you can do it in the Google Cloud Console)
  • Google service account (you can do it in the Google Cloud Console)
  • Credential JSON file to the service account
  • Configured environmental variable GOOGLE_APPLICATION_CREDENTIALS to the service account credentials


Install/upgrade the tool from PyPI using:

$ pip3 install --upgrade gupload


$ gupload --help
Usage: gupload [OPTIONS] [FILES]...

--to ID                    Target folder identifier.  [required]
-f, --file <NAME PATH>...  Input file(s) to be uploaded.
-n, --nono                 No action: print names of files to be upload, but
                            don't upload.
--version                  Show the version and exit.
--help                     Show this message and exit.


Upload and rename

$ gupload --folder 1OQ3lq2O1zqZ01vUgzvg1iyXXtBJRl6pW --file a.out ../a.out --file changelog.txt ../changelog.txt


Uploading file: a.out
Uploading file: changelog.txt

Upload all zip files

$ gupload --folder 1OQ3lq2O1zqZ01vUgzvg1iyXXtBJRl6pW *.zip


Uploading file:
Uploading file:


$ gupload --folder 1OQ3lq2O1zqZ01vUgzvg1iyXXtBJRl6pW --file changelog.txt ../changelog.txt *.zip


Uploading file: changelog.txt
Uploading file:
Uploading file:


Please read for details on our code of conduct, and the process for submitting pull requests to us.


We use SemVer for versioning. For the versions available, see the tags on this repository.



This project is licensed under the MIT License - see the LICENSE file for details.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gupload-1.1.0.tar.gz (5.8 kB view hashes)

Uploaded source

Built Distribution

gupload-1.1.0-py3-none-any.whl (4.7 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page