And, since keeping your company or even important personal data on SD cards, HDDs, and phones is very unsafe because the data might be lost due to degradation or theft, you should sync your data to a reliable storage service. Copy the ID of the folder by copying the text after the last “/” in the URL.If your company utilizes Google Workspace, chances are your data and photographs are scattered all over the place: your pc, phone, the digital camera you rarely use, and the many SD cards most likely accumulating dust. This is the folder you will use for syncing.ĦOpen the newly created folder. Move the “client_secrets.json” file to your project folder from your Downloads folder.Ĥ Go to and log in with the same account you used to create the Google Drive client ID file (see step 3).ĥInside your Google Drive, create a new folder and give it a descriptive name.Rename the JSON file (now located in your Downloads folder) to “client_secrets.json.”.Download the JSON file for the newly created credential.Click the big blue “Save” button at the bottom of the page.In the “Authorized JavaScript origins” and “Authorized redirect URIs” fields, enter “ and click “Save.”.Give your OAuth client ID a descriptive name.Click on “Create credentials” and select “OAuth client ID.”.Click on “Credentials” in the left-hand menu.Go to and log in with the Google account connected to the Google Drive you want to access.Otherwise, follow these steps to obtain the file: If you already have the file, you can skip the following instructions and move the client ID file into your project folder. The important thing is to make sure the contents of the repository files are in your own files with the same file names within the project folder.ģTo use Google’s API to access your Google Drive, you will need to obtain a credential file from the Google Developers Console. Alternatively, you can write the code yourself or a combination of the above methods. If you are new to programming, it may be simpler to create the folder on your desktop.ĢNext, clone the repository into the newly created folder (referred to as the “project folder” from here on) or copy the code into your own files within the project folder. Step-by-step guide for implementationġ To begin, create a new folder on your desktop (or elsewhere on your computer) and give it a descriptive name. If you need information on how to install packages with PIP, you can read this guide. There are many guides available on how to install both Python and PIP, so I will not cover that here. To follow along with this guide, you will need Python and a package management system, preferably PIP. In such cases, it can be useful to have a solution for syncing specific folders with Google Drive, without installing the app or manually uploading the folder. Many users find the cost of installing the Google Drive app on their computers outweighs their synchronization needs. This guide is intended to be concise and straightforward, and the code can be improved upon by readers as needed. In this guide, we will demonstrate how to use a simple Python program to upload a folder saved locally to Google Drive (through the Google Drive API).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |