Skip to main content

Experience better workflow with google colab, local jupyter notebooks and git

Project description

bingoset

Experience better workflow with google colab, local jupyter notebooks and git

Downloads PyPI - License PyPI - Python Version Twitter Follow

Welcome to colab-cli 👋

You can now easily manage working with jupyter notebooks and google colab from cli.

Features

  • 🤠 Upload local jupyter notebook to gdrive from cli
  • 😮 Quick access to jupyter notebooks in gdrive from your cli
  • 🚀 Keeps jupyter notebooks organized in gdrive by creating local file structure in gdrive
  • 🤯 Sync local work on notebooks with gdrive
  • 🥂 Git friendly, pull changes from gdrive and commit to git

✨ Demo

demo

Install

pip3 install colab-cli

Set-up

STEP-1:

First we need to get your client_secrets.json file for OAuth2.0 authentication for Drive API,

  1. Go to APIs Console and make your own project.

  2. Search for ‘Google Drive API’, select the entry, and click ‘Enable’.

  3. Select ‘Credentials’ from the left menu, click ‘Create Credentials’, select ‘OAuth client ID’.

  4. 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.

    c. Input http://localhost:8080 for ‘Authorized JavaScript origins’.

    d. Input http://localhost:8080/ for ‘Authorized redirect URIs’.

    e. Click ‘Save’.

  5. Click ‘Download JSON’ on the right side of Client ID to download client_secret_<really long ID>.json.

  6. Rename the file to “client_secrets.json” and place it in any directory.

STEP-2:

Go to the local directory with client_secrets.json

colab-cli set-config client_secrets.json

STEP-3:

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

Usage

colab-cli --help
  • List local ipynb
colab-cli list-nb

NOTE : Please work with git repo initialized, else below commands will not work

  • Open local ipynb file in google colab for first time

Note: It opens the copy of file in gdrive from second time onwards.

colab-cli open-nb lesson1-pets.ipynb
  • If you need to get modified ipynb from gdrive local directory use
colab-cli pull-nb lesson1-pets.ipynb
  • Made some changes to ipynb locally, push it to gdrive
colab-cli push-nb lesson1-pets.ipynb
  • To make a new notebook, you can use
colab-cli new-nb my_nb.ipynb

Author

👤 Akshay Ashok

🤝 Contributing

Contributions, issues and feature requests are welcome!

Feel free to check issues page. You can also take a look at the contributing guide.

Show your support

Give a 🌟 if this project helped you!

📝 License

Copyright © 2020 Akshay Ashok.

This project is MIT licensed.


This README was generated with ❤ by readme-md-generator

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

colab-cli-2.2.5.tar.gz (25.0 kB view details)

Uploaded Source

Built Distribution

colab_cli-2.2.5-py3-none-any.whl (29.5 kB view details)

Uploaded Python 3

File details

Details for the file colab-cli-2.2.5.tar.gz.

File metadata

  • Download URL: colab-cli-2.2.5.tar.gz
  • Upload date:
  • Size: 25.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.4 Windows/10

File hashes

Hashes for colab-cli-2.2.5.tar.gz
Algorithm Hash digest
SHA256 ac43a48986ac50d91517223a5c7406735454fbb80a7b18838c741012c228557c
MD5 1f56b6e25ecedad2f9db599260127edf
BLAKE2b-256 68028e34c7a7300a06eb4db5e445f26486951202f6c12bf7403b7120846229bd

See more details on using hashes here.

File details

Details for the file colab_cli-2.2.5-py3-none-any.whl.

File metadata

  • Download URL: colab_cli-2.2.5-py3-none-any.whl
  • Upload date:
  • Size: 29.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.5 CPython/3.7.4 Windows/10

File hashes

Hashes for colab_cli-2.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 7efc266cb542bfcd05a928bbd23cd9ac627dc8d0f885c9cc739efdbfcaed6860
MD5 1f5b2392cfcafacc38a141a8945fa353
BLAKE2b-256 66f2e2ef99936c1e82ecf726a6a50c8586347bd3a7f65637168818846597aece

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page