Code Monkey home page Code Monkey logo

google-drive-recursive-ownership's Introduction

Google Drive Recursive Ownership Tool

Supported Files

G Suite for Government and G Suite for Education accounts can change ownership of any file owned by the current user, including uploaded/synced files suchs as PDFs.

Other Google Accounts such as G Suite for Business or Personal Google Accounts can only transfer ownership of Google files (Docs, Sheets, Sildes, Forms, Drawings, My Maps, and folders).

NOTE: Ownership can only be transferred to members of the same G Suite or Google domain. Ex. @gmail.com can only transfer to other @gmail.com addresses.

NOTE: The Google Drive API does not allow suppressing notifications for change of ownership if the if the new owner does not already have access to the file. However, if the new owner already has access to the file, upgrading their permissions to ownership will not generate a notification.

Setup

git clone https://github.com/davidstrauss/google-drive-recursive-ownership
pip install --upgrade google-api-python-client oauth2client six

Usage

First, replace the sample client_secrets.json with your own client secrets. Otherwise, authorizations you create will be usable by anyone with access to the sample key (the entire internet).

Next, if transfer.py is contained in a folder listed in your system's PATH this can be run from anywhere. Otherwise it needs to be run from the directory where transfer.py is located.

python  transfer.py  PATH-PREFIX  NEW-OWNER-EMAIL  SHOW-ALREADY-OWNER
  • PATH-PREFIX assumes use of "/" or "" as appropriate for your operating system.

    • The PATH-PREFIX folder must be in My Drive section. For shared folders right click and select Add to My Drive.
  • SHOW-ALREADY-OWNER "true"|"false" (default true) to hide feedback for files already set correctly.

Windows Example:

python transfer.py "Folder 1\Folder 2\Folder 3" [email protected] true

Mac/Linux Example:

python transfer.py "Folder 1/Folder 2/Folder 3" [email protected] false

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.