This repository shows basic usage of the Drive v3 API.
This shows a sample of three different interactions with Google Drive through the Google Drive API v3
Note-worthy functions in the code:
- get_gdrive_results: Gets the top 10 files in your google drive
- upload_file: Uploads a brand new file to your google drive
- update_file: Updates an existing file with the contents of the file specified
- Download a credentials.json file by turning on the Drive API
- Install the required dependencies
pip install -r requirements.txt
- Run the code
python3 quickstart.py
The above command will prompt you to log in to your google account through a browser. Once you've logged in, it will create a token.pickle
file in your directory so you don't have to use your browser to log in again.
- You're done!