Giter Site home page Giter Site logo

aglaianwoman / upload-local-folder-to-google-drive-one-way-sync Goto Github PK

View Code? Open in Web Editor NEW

This project forked from magtun/upload-local-folder-to-google-drive-one-way-sync

0.0 1.0 0.0 104 KB

A Python script to automatically synchronize your local storage files with Google Drive content

Batchfile 1.51% Python 98.49%

upload-local-folder-to-google-drive-one-way-sync's Introduction

Upload a folder to Google drive from Windows context-menu

Source code: I_love_cats1

Difference with I_love_cats1

  • the folder path isn't handle in the same way
  • the variables have been renamed

To Do:

  • allow upload folder somewhere else than root of google drive
  • multiple upload

ReadMe from I_love_cats1

Google-Drive-sync

A Python script to automatically synchronize your Google Drive content with local storage files.

What it can do (for now)

  • Upload folder and all it's content from local storage to Google Drive
  • Check and synchronize changes on local storage with (same) Google Drive folder
  • Check and synchronize changes on Drive with its local storage instance

So, it's two-way synchronization of selected folders, which you can run at any time (in any 'direction') you want (isn't this a dream, yeah?).

Initial setup

  1. Turn on Google Drive API here (if you have any troubles, check Python Quickstart guide).
  2. Get your .json client secret config file in [Google API Projects page] and put it in working directory (don't forget to save it as client-secret.json)
  3. In upload_to_drive.py and download_from_drive.py file scripts change global variables FULL_PATH and DIR_NAME to your's full folder path and folder's name, which you want to upload/download/synchronize, respectively.
  4. First time you run upload_to_drive.py or download_from_drive.py, it will open browser/new tab, and you will need to authenticate the script (or if it doesn't redirect you, copy the link and do authentification manually).
  5. Run drive_sync.py script, if you want to apply changes made on local storage to specific Google Drive folder, and run download_from_drive.py if you want to apply changes from that Google Drive folder to your local storage.
  6. (Optional) put script that you need to cron or any other task planner that you use.
  7. Enjoy how simple it is!

Requirements and Dependencies

To run this amazing project, you will need:

  • Python 3 or higher installed
  • Google API Python library. To install it simply run
   sudo pip install --upgrade google-api-python-client

(or see this installation page for more information)

  • Google Account
  • Internet connection

All of these items are extremely important because if you won't have at least one of then, nothing will work :('

TO-DO and known problems/issues/features:

  • Only full path to folder allowed now (you can't put your script near folder and use it's relative path).
  • It's only one direction per time. So if you have changes on both local storage and Google Drive, you may lose part of your data. Be careful with that!
  • Sync scripts have troubles with handling extension-less non-googledocs files. Be careful here.
  • Epic things with Google Docs files. Initially, I didn't wanna even worry about that, because personally don't use them in my syncroised forlders. So finally I came up with this "duct tape" solution - when you download/update stuff from Drive to local storage, and it's 'google docs' file on Drive, it will add .extension to it's name (if need) so files will be the same on next run (for example .docx for Word files). Pay attention at this detail, if it's really important for you, it can be fixed relatively easy (for example by adding some external dictionary near scripts that will remember about correlations between Drive doc and its local storage exported copy, or something like that). Maybe someday this will be fixed.
  • There is no error/exception handling for now.

Support

If you have any questions how to use this stuff, offerings or simply want to contact me, please write me anytime on Telegram @I_love_cats1 or email [email protected].

upload-local-folder-to-google-drive-one-way-sync's People

Contributors

dtsvetkov1 avatar

Watchers

James Cloos 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.