Skip to main content

Welcome to colab-cli 👋

License: MIT Twitter: aks2899

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

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

python -m pip install colab-cli

OR

python3.7 -m pip 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

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

Release files for colab-cli 2.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for colab-cli 2.2.1
File Size Uploaded
colab-cli-2.2.1.tar.gz 7.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for colab-cli 2.2.1
File Interpreter ABI Platform
colab_cli-2.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 18.5 kB

Release files / colab-cli-2.2.1.tar.gz

Download URL colab-cli-2.2.1.tar.gz
Size 7.8 kB
Tags Source
SHA-256 checksum
How to use checksums
56f9defdbc44b98939d55bafc72f827a57009a6c06a215004964be5cac597050
BLAKE2b-256 checksum
How to use checksums
6d5ac702e7f7bbe9f46354874644bc9b23470305d94cab87c7ec2fa8c62c070f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.7.4 Windows/10

Release files / colab_cli-2.2.1-py3-none-any.whl

Download URL colab_cli-2.2.1-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
661d57680a758ef903d1dc4e24ce87a68b7e5dd3b5ca65dc54231b21ff239e77
BLAKE2b-256 checksum
How to use checksums
1875e28cdd405f84633a28a84d42a2d3eec4fa4fab2e0b4c808beb2f4be6cc70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.0.5 CPython/3.7.4 Windows/10

Release history Release notifications | RSS feed

2.2.5

2 release files

2.2.4

2 release files

2.2.3

2 release files

2.2.2

2 release files

This release

2.2.1 This release

2 release files

2.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page