Skip to main content

A library to set up a VS Code server in Google Colab.

Project description

vscode-colab: Connect VS Code to Google Colab and Kaggle Runtimes

PyPI version License: MIT Python Version Open In Colab

vscode-colab is a Python library that enables you to connect your Google Colab or Kaggle notebooks to your local Visual Studio Code (VS Code) editor using VS Code Remote Tunnels. This integration allows you to leverage the full capabilities of VS Code while utilizing the computational resources of cloud-based notebooks.

🚀 Features

  • Seamless connection between Colab/Kaggle notebooks and local VS Code editor.
  • Utilizes official VS Code Remote Tunnels for secure and efficient connectivity.
  • Minimal setup with intuitive login() and connect() functions.
  • Interactive UI elements within notebooks for enhanced user experience.

🧰 Installation

Install the package via pip:

pip install vscode-colab

📖 Usage

Open In Colab

1. Import the Library

In your Colab or Kaggle notebook, import the vscode_colab module:

import vscode_colab

2. Authenticate with VS Code

Run the login() function to authenticate your session:

vscode_colab.login()

Login

This will display a code and a URL. Click the URL, enter the code, and sign in with your GitHub or Microsoft account to authorize the connection.

3. Establish the Tunnel

After successful authentication, initiate the tunnel:

vscode_colab.connect()

Login

This will start the VS Code tunnel, allowing you to connect your local VS Code editor to the Colab/Kaggle environment.

4. Connect via VS Code

In your local VS Code editor:

  1. Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P).
  2. Select Remote Tunnels: Connect to Tunnel....
  3. Choose the tunnel corresponding to your notebook session.

You are now connected to your Colab/Kaggle environment through VS Code!

⚠️ Notes

  • The connect() function will block the notebook cell execution as it maintains the tunnel connection. To terminate the tunnel, you can:
    • Interrupt the cell execution.
    • Close the notebook tab.
    • Shut down the notebook runtime.
  • Ensure that your local VS Code editor has the Remote Tunnels extension installed.

🧪 Testing

To run the test suite:

git clone https://github.com/EssenceSentry/vscode-colab.git
cd vscode-colab
pip install -r requirements-dev.txt
pytest

🛠️ Development

The project uses setup.cfg for configuration and requirements-dev.txt for development dependencies. Contributions are welcome!

📄 License

This project is licensed under the MIT License. See the LICENSE file for details.

🙏 Acknowledgments

Special thanks to the developers of VS Code Remote Tunnels for enabling seamless remote development experiences.

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

vscode_colab-0.1.3.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

vscode_colab-0.1.3-py3-none-any.whl (7.8 kB view details)

Uploaded Python 3

File details

Details for the file vscode_colab-0.1.3.tar.gz.

File metadata

  • Download URL: vscode_colab-0.1.3.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for vscode_colab-0.1.3.tar.gz
Algorithm Hash digest
SHA256 a04161811d4d1e033de42f752724873608a35a499a126ee5a2d2da138b4ad5a1
MD5 103d58dcc3bd4019941a955eeaa72375
BLAKE2b-256 0b448195c19ebd32c985936221efc3acf78f1d56a610ad67ef8873add96f2deb

See more details on using hashes here.

File details

Details for the file vscode_colab-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: vscode_colab-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.7

File hashes

Hashes for vscode_colab-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0d87364e0ff1b7ce82ed62a0c0fff537097402c84db8a964597ca268a291f85a
MD5 9164f7e16b7f6860eaaac8e2cb60e5dd
BLAKE2b-256 f7c94e7d34effc425144b968e047d314076bb950f30f0ab53b9911824222c994

See more details on using hashes here.

Supported by

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