Skip to main content

CircleCI

Google Drive Folder Cloner

Contents

  1. Description
  2. Install
  3. Usage
  4. Contributing

Description

A python package for cloning google drive folders, including all subdirectories and files

Installation

To install from the pypi release

pip install googledrive_cloner

To install locally

git clone https://github.com/NickHilton/googledrivecloner.git

Google Drive Set up

In order for this package to work, any GDrive account you use must be set up with the correct permissions. More detail is given in Google's documentation

The following steps should get you set up correctly

  1. Create a Google Project - here
  2. Enable the Google Drive API on your project - here
  3. Create a service account for authorization as described in the documentation
  4. Save the client-secret created during the previous step to your environment and set the environment variable CLIENT_SECRET_PATH to point to the file
  5. Enable sharing for the folder you wish to copy, and share the folder with the email from the created service account

Usage

To clone a directory you need to get both the gdrive id of the folder to be copied and the destination folder. You can discover these ids by looking at the url

https://drive.google.com/drive/u/0/folders/{FOLDER_ID}

The cloner can be used in the following way:

from googledrive_cloner.google_connections import GoogleDriveCloner
googledrivecloner = GoogleDriveCloner()
folder_id_to_copy = 'XXXXXXXX'
destination_folder_id = 'YYYYYYYYY'
new_folder_name = 'lemons'  # Or something else!

googledrivecloner.run(
    base_folder_id=folder_id_to_copy, 
    destination_parent_folder_id=destination_folder_id, 
    new_name=new_folder_name
)

Contributing

All contributions are welcome, feel free to ask a question or propose a change via a Pull Request

Running Tests

In the root/src directory

python -m unittest discover

Release files for googledrive-cloner 1.0.3

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

Source distribution (sdist)

Source distribution for googledrive-cloner 1.0.3
File Size Uploaded
googledrive_cloner-1.0.3.tar.gz 6.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for googledrive-cloner 1.0.3
File Interpreter ABI Platform
googledrive_cloner-1.0.3-py3-none-any.whl Python 3 none any Details

Total release size: 17.6 kB

Release files / googledrive_cloner-1.0.3.tar.gz

Download URL googledrive_cloner-1.0.3.tar.gz
Size 6.7 kB
Tags Source
SHA-256 checksum
How to use checksums
530d39a8d841edb390eb7dc4b0068660df4b366a8544ae40b801cbd36bc7c19b
BLAKE2b-256 checksum
How to use checksums
3d0542c282fd59b4c96f02f677a46bcdc7e97e95c2e6f7d311cc64287f0ecd26
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7

Release files / googledrive_cloner-1.0.3-py3-none-any.whl

Download URL googledrive_cloner-1.0.3-py3-none-any.whl
Size 10.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b5dd983e9c8783e0d6bdec8b37a645b01b463562b80d47c4d14233302e5cdd32
BLAKE2b-256 checksum
How to use checksums
cdc285b5d3352138435366d9236cfbe52365076333947f2c6bee2fb9de9e93e8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.7

Release history Release notifications | RSS feed

This release

1.0.3 This release

2 release files

1.0.2

2 release files

1.0.0

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