You can now easily manage working with jupyter notebooks and google colab from cli.
pip3 install colab-cli
First we need to get your client_secrets.json file for OAuth2.0 authentication for Drive API,
Go to APIs Console and make your own project.
Search for ‘Google Drive API’, select the entry, and click ‘Enable’.
Select ‘Credentials’ from the left menu, click ‘Create Credentials’, select ‘OAuth client ID’.
Now, the product name and consent screen need to be set -> click ‘Configure consent screen’ and follow the instructions. Once finished:
a. Select ‘Application type’ to be Web application.
b. Enter an appropriate name.
d. Input http://localhost:8080/ for ‘Authorized redirect URIs’.
e. Click ‘Save’.
Click ‘Download JSON’ on the right side of Client ID to download clientsecret\.json.
Rename the file to “client_secrets.json” and place it in any directory.
Go to the local directory with client_secrets.json
colab-cli set-config client_secrets.json
Now we need to set the google account user id, goto your browser and see how many google logins you have, the count start from zero
for eg. I have 3 login and I use the second one for coding work, so my user id is 1
colab-cli set-auth-user 1
🙌 Now You're all set to go
NOTE : Please work with git repo initialized, else below commands will not work
Note: It opens the copy of file in gdrive from second time onwards.
colab-cli open-nb lesson1-pets.ipynb
colab-cli pull-nb lesson1-pets.ipynb
colab-cli push-nb lesson1-pets.ipynb
colab-cli new-nb my_nb.ipynb
👤 Akshay Ashok
Contributions, issues and feature requests are welcome!
Give a 🌟 if this project helped you!
Copyright © 2020 Akshay Ashok.
This project is MIT licensed.
This README was generated with ❤ by readme-md-generator