Skip to content

An app that syncs a folder on google drive with a local folder on the system. Sync is one-way, from local folder to the sync folder on google drive(Keeping in mind the limited storage on google drive). Lets you sync (adds new file in local folder to google drive folder and deletes the file from google drive folder that are not present in local f…

Notifications You must be signed in to change notification settings

NaturalTutelage/Google-Drive-Sync-App

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Google-Drive-Sync-App

An app that syncs a folder on google drive with a local folder on the system. Sync is one-way, from local folder to the sync folder on google drive(Keeping in mind the limited storage on google drive). Lets you sync (adds new file in local folder to google drive folder and deletes the file from google drive folder that are not present in local folder anymore at once)any number of file and any format file from local folder to google drive on a click of a button.

Used Google Drive APIs. Language used to code is Python.

2 files needed to run the app(personal credentials.json file for authentication that can be downloaded when you enable the Google Drive API and a toke.pickle file which gets autogenerated for staying authenticated after the first time) and the script needed to be converted into a executable to be used as an app ( used PyInstaller /* another option is py2exe*/) otherwise could be run in any Python Editor / IDE.

Usage flow of the app:

  1. Download / paste files in the local folder included in the app script.
  2. Run the executable (if converted to .exe) / Run the script - Checks the files in google drive folder included in the script function call. If no folder found -creates one with the same name. Otherwise uploads new files to the google drive folder. And then deletes the files not present in the local folder anymore from the google drive folder. 3.Ends execution.

Now, the flow is one way from local to google drive folder. I created this app to fulfill my need to upload multiple files of any format at once with a click of a button as I read a lot from pdfs/images/textfiles etc. And keeping in mind the google drive limited storage any file not present in the local folder should be removed from the google drive folder as well to save space and also remove unwanted files or the files not needed anymore.

Challenges faced:

  1. Need of creating or using different folder anothet time : Solved by passing it as a parameter to a def in main.
  2. Uploading and deleting files with any format : Solved by using "mimetype='application/octet-stream'"(Line #80 in code).
  3. Selecting a particular folder only : Solved by using q query in Gdrive API , folder id in metadata(unique identifier).

Same app can be modified to sync it both ways. Any activity on either of the folder will affect the other one. So feel free to do it or if any other idea to make it more robust and better. (Will upload that fucntionality added in sometime as well)

Now I wanted this to be in control before the sync hence I used executable form. After click the button only it'll do all the work.

Feel free to use the app. Will upload the executable as well ( Remember to use your own credentials.json and token.pickle file in root folder)

@kar7ik

About

An app that syncs a folder on google drive with a local folder on the system. Sync is one-way, from local folder to the sync folder on google drive(Keeping in mind the limited storage on google drive). Lets you sync (adds new file in local folder to google drive folder and deletes the file from google drive folder that are not present in local f…

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages