Skip to main content

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

Requirements

  • 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

Installation

Install/upgrade the tool from PyPI using:

$ pip3 install --upgrade gupload

Usage

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

Options:
--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.

Example:

Upload and rename

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

Output:

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

Upload all zip files

$ gupload --folder 1OQ3lq2O1zqZ01vUgzvg1iyXXtBJRl6pW *.zip

Output:

Uploading file: a.zip
Uploading file: b.zip

Combination

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

Output:

Uploading file: changelog.txt
Uploading file: a.zip
Uploading file: b.zip

Contributing

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

Versioning

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

Authors

License

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

Metadata

Release files for gupload 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gupload 1.1.0
File Size Uploaded
gupload-1.1.0.tar.gz 5.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gupload 1.1.0
File Interpreter ABI Platform
gupload-1.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.4 kB

Release files / gupload-1.1.0.tar.gz

Download URL gupload-1.1.0.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8144735e0ec0f76245d502e3f400f6c372c1c4a4dcc3c37d768eadea8da36c6b
BLAKE2b-256 checksum
How to use checksums
1220b93e97ccff86142ab9b9da52875c8b180cfc37af695d24a9070173da1add
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.3

Release files / gupload-1.1.0-py3-none-any.whl

Download URL gupload-1.1.0-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e1d75142ace121a63c2c40f1c485b73decc1bfc81f0ba2fdd210c726d9cb4e69
BLAKE2b-256 checksum
How to use checksums
b5eacd751e2eb1c8957bb6e5fb9c2e0329be5904fc9b432617bb2e83681834dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.3

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page