{"id":13835528,"url":"https://github.com/ctberthiaume/gdcp","last_synced_at":"2025-07-10T07:32:27.400Z","repository":{"id":24739875,"uuid":"28152314","full_name":"ctberthiaume/gdcp","owner":"ctberthiaume","description":"scp like tool to interact with Google Drive from the command-line","archived":true,"fork":false,"pushed_at":"2024-12-03T19:00:43.000Z","size":79,"stargazers_count":161,"open_issues_count":0,"forks_count":20,"subscribers_count":20,"default_branch":"master","last_synced_at":"2024-12-03T20:18:28.455Z","etag":null,"topics":["google-drive","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ctberthiaume.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-12-17T19:38:11.000Z","updated_at":"2024-12-03T19:01:07.000Z","dependencies_parsed_at":"2024-11-20T20:33:50.797Z","dependency_job_id":"9b083279-3ca6-4d94-94ae-979f680b4815","html_url":"https://github.com/ctberthiaume/gdcp","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ctberthiaume/gdcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctberthiaume%2Fgdcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctberthiaume%2Fgdcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctberthiaume%2Fgdcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctberthiaume%2Fgdcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ctberthiaume","download_url":"https://codeload.github.com/ctberthiaume/gdcp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctberthiaume%2Fgdcp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264545168,"owners_count":23625404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["google-drive","python"],"created_at":"2024-08-04T14:01:04.374Z","updated_at":"2025-07-10T07:32:27.390Z","avatar_url":"https://github.com/ctberthiaume.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# gdcp\n\nThis project is not being actively maintained and has been archived.\n\ngdcp (**G**oogle **D**rive **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.\n\n\nNotable features:\n\n* supports large file transfers\n* MD5 checksum verification\n* recursive folder upload and download\n* recursive depth-limited folder listing\n* recursive ownership transfer\n* compensates for errors during uploads and downloads, resuming partial transfers when possible and retrying complete transfers otherwise\n\n## Installation\n`gdcp` is a python script which depends on\n\n* 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.\n* [PyDrive](https://pypi.python.org/pypi/PyDrive)\n* [backoff](https://pypi.python.org/pypi/backoff)\n\nThe easiest way to install Python dependencis is with `pip`.\n\n```\n$ pip install pydrive\n$ pip install backoff\n```\n\n**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](https://www.macports.org/) or [Homebrew](http://brew.sh/)) and/or use [virtualenv](https://virtualenv.pypa.io/en/latest/). See [pypia/pip#2468](https://github.com/pypa/pip/issues/2468) for more details.\n\nIf `pip` is not already installed on your system, it should be possible to install it with `easy_install`.\n\n```\n$ easy_install pip\n```\n\nThese 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`.\n\nNow place `gdcp` somwhere in your path.  For example, if `~/bin` is in your path\n\n```\n$ git clone https://github.com/ctberthiaume/gdcp.git\n$ cp gdcp/gdcp ~/bin\n```\n\n## Usage\n\n### Setup\nThe 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.\n\n```\n- Visit https://console.developers.google.com/\n- Create a new project and select it\n- Under 'APIs' make sure the 'Drive API' is turned on\n- Under 'Credentials' create a new OAuth client ID\n  Choose 'Installed -\u003e Other' for application type\n- Click 'Download JSON' to download the secrets file\n- Copy the secrets file to ~/.gdcp/client_secrets.json\n```\n\nOnce you've created `~/.gdcp/client_secrets.json`, run `gdcp` again to authorize access to your Google Drive. You should see something like\n\n```\nGo to the following link in your browser:\n```\n\nfollowed 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.\n\n### Subcommands\n\n#### list\nList file metadata. For example, to list information about a Googel Drive folder with ID `0Bxt5Ia3JxzdHfkJDeUxCQ3RyaWp`.\n\n```\n$ gdcp list -i 0Bxt5Ia3JxzdHfkJDeUxCQ3RyaWp\nfoo 0Bxt5Ia3JxzdHfkJDeUxCQ3RyaWp\tfolder\nfoo/bar.txt\t0Bxt5Ia3JxzdHZGtabW9xTEduSkE\tfile\t7\t14758f1afd44c09b7992073ccf00b43d\n```\n\nThis 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.\n\n#### upload\nRecursively upload files or folders. For example, to upload a local folder into a Google Drive parent folder with ID `0Bxt5Ia3JxzdHfkJDeUxCQ3RyaWp`.\n\n```\n$ gdcp upload -p 0Bxt5Ia3JxzdHfkJDeUxCQ3RyaWp ./subfolder\nsubfolder/\nsubfolder/subfile.txt\n  100.00% 209715200 44.08MB/s 4.76s MD5...OK\nUploaded 2 file(s) and folder(s)\n```\n\nBy default `gdcp` will compare the MD5 checksum of local files against the checksum reported by Google after upload.\n\n#### download\nRecursively download files or folders. For example, to download a Google Drive folder with ID  `0Bxt5Ia3JxzdHfkJDeUxCQ3RyaWp`.\n\n```\n$ gdcp download -i 0Bxt5Ia3JxzdHfkJDeUxCQ3RyaWp .\n./foo/subfolder/\n./foo/subfolder/subfile.txt\n  100.00% 209715200 50.32MB/s 4.17s MD5...OK\n./foo/bar.txt\n  100.00% 7 0.00MB/s 0.49s MD5...OK\nDownloaded 4 file(s) and folder(s)\n```\n\nBy default `gdcp` will compare the MD5 checksum of local files against the checksum reported by Google after download.\n\n#### transfer\nRecursively transfer ownership of files or folders to another Google Apps account. For example, to transfer folder `0Bxt5Ia3JxzdHfkJDeUxCQ3RyaWp ` and all of its contents.\n\n```\ngdcp transfer -i 0Bxt5Ia3JxzdHfkJDeUxCQ3RyaWp -e newowner@gmail.com\nfoo\t0Bxt5Ia3JxzdHfkJDeUxCQ3RyaWp\nsubfolder\t0Bxt5Ia3JxzdHcVJxVTRfYVdOdmc\nsubfile.txt\t0Bxt5Ia3JxzdHN0NqUEh3RnJic28\nbar.txt\t0Bxt5Ia3JxzdHZGtabW9xTEduSkE\nTransferred ownership for 4 file(s)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctberthiaume%2Fgdcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fctberthiaume%2Fgdcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctberthiaume%2Fgdcp/lists"}