All Projects → ctberthiaume → Gdcp

ctberthiaume / Gdcp

Licence: other
scp like tool to interact with Google Drive from the command-line

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Gdcp

Gdrivedownloader
Just enter the direct URL of the file and it will upload it to Google Drive and print download link of it.
Stars: ✭ 60 (-55.88%)
Mutual labels:  google-drive
Aria2.conf
Aria2 配置文件 | OneDrive & Google Drvive 离线下载 | 百度网盘转存
Stars: ✭ 1,321 (+871.32%)
Mutual labels:  google-drive
Rxdrive
RxJava wrapper for Google Drive Android API
Stars: ✭ 106 (-22.06%)
Mutual labels:  google-drive
Torrent To Google Drive Downloader
Simple notebook to stream torrent files to Google Drive using Google Colab and python3.
Stars: ✭ 63 (-53.68%)
Mutual labels:  google-drive
Zdownloader
zdownloader is a download manager for ZippyShare, Google Drive and MegaUp services
Stars: ✭ 88 (-35.29%)
Mutual labels:  google-drive
Gdrivesync.js
Javascript wrapper library for Google Drive API v3
Stars: ✭ 94 (-30.88%)
Mutual labels:  google-drive
Googledriveuploadtool
A tool for Windows to upload and manage files in Google Drive. It resumes uploads in case of an error or failure. Perfect for uploading large files or if your connection is unstable.
Stars: ✭ 58 (-57.35%)
Mutual labels:  google-drive
Plexidrive
Scripts to facilitate the use of cloud storage (such as Google Drive) as storage for Plex media server
Stars: ✭ 118 (-13.24%)
Mutual labels:  google-drive
Create Google Shared Drive
Cloudflare Redesigned Script for creating a Shared/Team Drive
Stars: ✭ 93 (-31.62%)
Mutual labels:  google-drive
Gdindex
A Google Drive Index built with Vue Running on CloudFlare Workers
Stars: ✭ 1,384 (+917.65%)
Mutual labels:  google-drive
Cyberduck
Cyberduck is a libre FTP, SFTP, WebDAV, Amazon S3, Backblaze B2, Microsoft Azure & OneDrive and OpenStack Swift file transfer client for Mac and Windows.
Stars: ✭ 1,080 (+694.12%)
Mutual labels:  google-drive
Cloud Media Scripts
Upload and stream media from the cloud with or without encryption. Cache all new and recently streamed media locally to access quickly and reduce API calls
Stars: ✭ 84 (-38.24%)
Mutual labels:  google-drive
Goindex Theme Acrou
This is a goindex theme.一个goindex的扩展主题。
Stars: ✭ 1,332 (+879.41%)
Mutual labels:  google-drive
Fantasy Football Metrics Weekly Report
Command line application to create weekly reports (containing stats, metrics, and rankings) for Fantasy Football leagues on the following platforms: Yahoo, Fleaflicker, Sleeper, ESPN.
Stars: ✭ 62 (-54.41%)
Mutual labels:  google-drive
G Desktop Suite
Google Suite as a desktop app. Made possible with Electron.
Stars: ✭ 1,529 (+1024.26%)
Mutual labels:  google-drive
Holysheet
A program to store arbitrary files in Google Sheets
Stars: ✭ 59 (-56.62%)
Mutual labels:  google-drive
Plexdrive
Plexdrive mounts your Google Drive FUSE filesystem (optimized for media playback)
Stars: ✭ 1,324 (+873.53%)
Mutual labels:  google-drive
Plexguide.com
Welcome to https://PlexGuide.com ~ Rapidly deploy multiple-hasty Docker Containers through Ansible with local or Unlimited Google HD Space!
Stars: ✭ 1,631 (+1099.26%)
Mutual labels:  google-drive
Telegram Clonebot
Simple Bot to clone Google Drive Files (or Folders) to your Team Drive[or Normal Drive]. P.S This is not a Mirror Bot. Enjoy ✌🏻
Stars: ✭ 114 (-16.18%)
Mutual labels:  google-drive
Hexopress
A tiny blogging platform that lets you write posts in Google Docs and syncs with a Google Drive directory.
Stars: ✭ 102 (-25%)
Mutual labels:  google-drive

gdcp

gdcp (Google Drive cp) is a command-line tool that supports robust and fast file transfers to and from Google Drive, somewhat analogous to using scp to transfer files to and from a Linux/Unix server. It is designed to be used in a workflow where large data sets stored in Google Drive are downloaded to a server for processing and results are uploaded back to Google Drive.

Notable features:

  • supports large file transfers
  • MD5 checksum verification
  • recursive folder upload and download
  • recursive depth-limited folder listing
  • recursive ownership transfer
  • compensates for errors during uploads and downloads, resuming partial transfers when possible and retrying complete transfers otherwise

Installation

gdcp is a python script which depends on

  • Python 2.7. Python 3 is not supported. If you see syntax errors about exception handling or print statements make sure gdcp is not being run with Python 3.
  • PyDrive
  • backoff

The easiest way to install Python dependencis is with pip.

$ pip install pydrive
$ pip install backoff

OS X Note PyDrive and its dependencies (notably six) may not install correctly in OS X when using system Python and pip. To get around this, use a non-system Python (e.g. from MacPorts or Homebrew) and/or use virtualenv. See pypia/pip#2468 for more details.

If pip is not already installed on your system, it should be possible to install it with easy_install.

$ easy_install pip

These commands may require superuser privileges (e.g. sudo) if you wish to install to system locations. Otherwise, install libraries with --user to install to your home directory or install libraries in an isolated Python environment with virtualenv.

Now place gdcp somwhere in your path. For example, if ~/bin is in your path

$ git clone https://github.com/ctberthiaume/gdcp.git
$ cp gdcp/gdcp ~/bin

Usage

Setup

The first time you run gdcp a new directory ~/.gdcp/ will be created and you'll be greeted with the following instructions for obtaining your own OAuth2 client ID.

- Visit https://console.developers.google.com/
- Create a new project and select it
- Under 'APIs' make sure the 'Drive API' is turned on
- Under 'Credentials' create a new OAuth client ID
  Choose 'Installed -> Other' for application type
- Click 'Download JSON' to download the secrets file
- Copy the secrets file to ~/.gdcp/client_secrets.json

Once you've created ~/.gdcp/client_secrets.json, run gdcp again to authorize access to your Google Drive. You should see something like

Go to the following link in your browser:

followed by a long URL. Visiting this URL in a browser where you're already logged into your Google account will yield a verification code. Copy and paste this code into the terminal to complete the authentication process. A new file, ~/.gdcp/credentials.json, will be created which grants access to your Google Drive files. If you want to use gdcp on a different computer without going through authentication again, just copy ~/.gdcp/ to the new computer.

Subcommands

list

List file metadata. For example, to list information about a Googel Drive folder with ID 0Bxt5Ia3JxzdHfkJDeUxCQ3RyaWp.

$ gdcp list -i 0Bxt5Ia3JxzdHfkJDeUxCQ3RyaWp
foo 0Bxt5Ia3JxzdHfkJDeUxCQ3RyaWp	folder
foo/bar.txt	0Bxt5Ia3JxzdHZGtabW9xTEduSkE	file	7	14758f1afd44c09b7992073ccf00b43d

This prints information about that folder and its first-level contents. Tab-delimited columns are title, id, type, fileSize, md5Checksum. Type will be file or folder for downloadable files and folders. For files created with a Google Apps app - documents, spreadsheets, maps, third-party apps, etc - the type reported will be the name parsed from the file's MIME type. For example, a Google Sheets file with MIME type application/vnd.google-apps.spreadsheet has type spreadsheet. To increase the depth of the recursive metadata listing specify a --depth value greater than 0.

upload

Recursively upload files or folders. For example, to upload a local folder into a Google Drive parent folder with ID 0Bxt5Ia3JxzdHfkJDeUxCQ3RyaWp.

$ gdcp upload -p 0Bxt5Ia3JxzdHfkJDeUxCQ3RyaWp ./subfolder
subfolder/
subfolder/subfile.txt
  100.00% 209715200 44.08MB/s 4.76s MD5...OK
Uploaded 2 file(s) and folder(s)

By default gdcp will compare the MD5 checksum of local files against the checksum reported by Google after upload.

download

Recursively download files or folders. For example, to download a Google Drive folder with ID 0Bxt5Ia3JxzdHfkJDeUxCQ3RyaWp.

$ gdcp download -i 0Bxt5Ia3JxzdHfkJDeUxCQ3RyaWp .
./foo/subfolder/
./foo/subfolder/subfile.txt
  100.00% 209715200 50.32MB/s 4.17s MD5...OK
./foo/bar.txt
  100.00% 7 0.00MB/s 0.49s MD5...OK
Downloaded 4 file(s) and folder(s)

By default gdcp will compare the MD5 checksum of local files against the checksum reported by Google after download.

transfer

Recursively transfer ownership of files or folders to another Google Apps account. For example, to transfer folder 0Bxt5Ia3JxzdHfkJDeUxCQ3RyaWp and all of its contents.

gdcp transfer -i 0Bxt5Ia3JxzdHfkJDeUxCQ3RyaWp -e [email protected]
foo	0Bxt5Ia3JxzdHfkJDeUxCQ3RyaWp
subfolder	0Bxt5Ia3JxzdHcVJxVTRfYVdOdmc
subfile.txt	0Bxt5Ia3JxzdHN0NqUEh3RnJic28
bar.txt	0Bxt5Ia3JxzdHZGtabW9xTEduSkE
Transferred ownership for 4 file(s)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].