Giter VIP home page Giter VIP logo

gdrive-uploader's Introduction

Google Drive uploader

This Python 3 script allows to archive a local folder, as a ZIP file, and upload it to a Google Drive folder. It allows to easily backup a folder from a server for example.

By using the very specific OAuth2 scope https://www.googleapis.com/auth/drive.file, the token generated for this app only gives access to Google Drive and only to the folder and the files this script has created (or the user has decided to give access to). If the token is leaked it is less dangerous than disclosing the full Google account credentials!

Here is how this permission is displayed by Google when granting access to the application:

You can review or revoke this given permission on https://myaccount.google.com/permissions:

Code inspired from: Google Drive Python quickstart

credentials.json

This file is required for the script to work. See instructions on: https://developers.google.com/drive/activity/v1/quickstart/python#step_1_turn_on_the

  1. Create an app and give it a name
  2. Choose "Desktop app" type
  3. Click on "Download client configuration" and you will get the credentials.json file you need! This will declare the OAuth2 application.

Then you need to authorize it to access the Google Drive space of your Google account, so for the first time run the application on your desktop as you will get prompted in the browser. Then it can work fine on a headless server.

Known limitations

  • ZIP file is prepared in-memory, so be careful with its size!

gdrive-uploader's People

Contributors

cnotin avatar thethor12 avatar

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.