Skip to main content

Google Drive tool

Project description

Google Drive Utility

What is Google Drive Utility?

Google Drive Utility provides an easy way to use Google Drive from command line, tasks such as uploading files/folders, downloading them, moving folders/files. Additionally, using the provided .reg files it can be added to the Windows Context Menu, giving the opportunity of using it anywhere in an very easy and friendly way. It is written in Python 2.7. It is licensed under the MIT license, see LICENSE.

Installation

Download and installation

You can download it with Pip:

pip install DriveUtil

Usage

Command line utility

Usage:

DriveUtil [Args]

or:

python -m DriveUtil [Args]

Available options are:

  -h, --help            show this help message and exit
  -u, --upload Path(s) [Path(s) ...]
                        Path of folder or file to upload.
  -s, --specificf Path(s) [Path(s) ...]
                        Path of folder or file to upload to a specific folder.
  -c, --createf         Creates a folder.
  -r, --remove          Remove access to Drive.
  -l, --list            List Drive files and folders.
  -d, --delete          Delete selected file or folder.
  -g, --get [Path]      Download file or folder. Optionally, you can specify a
                        path to downlaod there.
  -m, --move            Move file or folder.

Implementing it

Module main.py holds two functions, Auth() and DeleteCred() and the mainclass. The first one return the Drive API object after a successfully Oauth autentication, and the second remove the Oauth stored token. The drive.py module import main.py and imlements the Drive class wich inherits from main class. Botch classes instantiation need the Drive API object parameter.

Methods:

Method Param 1 Param 2 Param 3 Param 4 Return
Upload path FolderId=None True if successful. False if not
UploadSpecificFolder path Id=None True if successful. False if not
CreateFolder Id of the newly created folder
Download path=None Id=None True if successful. False if it fails
Copy Id=None True if successful. False if it fails
SearchByName
Delete Id=None True if successful. False if it fails
List FolderId=None OnlyFolder=False SelectId=False query=None Folder/file Id if SelectId=True. None otherwise
Move True if successful. False if it fails
AddStar True if successful. False if it fails
RemoveStar True if successful. False if it fails

Windows Context Menu

Adding it

The provided python scripts, addContext.py and removeContext.py add new optoins to the Context Menu, making DriveUtil more flexible to use. These two scripts must be run with admin rights. You can use:

python -m DriveUtil.addContext

and

python -m DriveUtil.removeContext

from an elevetad Windows command prompt.

Context Menu

Examples

clean_bin.py and example.py are two sample scripts. The first one will removed all files in the Drive Bin and the second will upload the contents of Test folder.

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

DriveUtility-0.0.1.tar.gz (8.6 kB view hashes)

Uploaded Source

Built Distribution

DriveUtility-0.0.1-py2-none-any.whl (12.1 kB view hashes)

Uploaded Python 2

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