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

Logo

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.4.tar.gz (12.6 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.4-py3-none-any.whl (9.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: vscode_colab-0.1.4.tar.gz
  • Upload date:
  • Size: 12.6 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.4.tar.gz
Algorithm Hash digest
SHA256 be052091f1cad1d91e2b8da2902e87a2c84c1d5e5b3b8747defab9553163536c
MD5 46eec40aecc5ba91da6a8dc9d1a02815
BLAKE2b-256 e9282b227b17ddc28acdffa62d390fe47ba3e3a072582c0241c7829db77c1097

See more details on using hashes here.

File details

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

File metadata

  • Download URL: vscode_colab-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 9.5 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1cfb1a10e676cbf9f7454c8053c2f9c53bb66d8b194e99dc6a3a87ae8f940e17
MD5 812f7f1fb60d4ed130e65cc2f9a78ecc
BLAKE2b-256 3ee786647dfa0283de6359b64e7fc603a981bc2f555cfc044932bbacc84862cc

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