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
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()andconnect()functions. - Interactive UI elements within notebooks for enhanced user experience.
🧰 Installation
Install the package via pip:
pip install vscode-colab
📖 Usage
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()
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()
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:
- Open the Command Palette (
Ctrl+Shift+PorCmd+Shift+P). - Select
Remote Tunnels: Connect to Tunnel.... - 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a04161811d4d1e033de42f752724873608a35a499a126ee5a2d2da138b4ad5a1
|
|
| MD5 |
103d58dcc3bd4019941a955eeaa72375
|
|
| BLAKE2b-256 |
0b448195c19ebd32c985936221efc3acf78f1d56a610ad67ef8873add96f2deb
|
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d87364e0ff1b7ce82ed62a0c0fff537097402c84db8a964597ca268a291f85a
|
|
| MD5 |
9164f7e16b7f6860eaaac8e2cb60e5dd
|
|
| BLAKE2b-256 |
f7c94e7d34effc425144b968e047d314076bb950f30f0ab53b9911824222c994
|