Google Colab workflow utilities
Project description
colab-assist
Google Colab workflow utilities
About
-
colab-assist is a small package that shares the utility functions that I find useful for my development workflows on Google Colab.
-
Actually, this is also a semi-mock project that I use to learn Python open-source development. Feedbacks, pointers, and feature suggestions are much appreciated!
Usage
Experimenting your private Python package on Colab
-
Develop your package any way you like and push it to your private GitHub repo.
-
Make a repo-specific personal access token (PAT).
-
Store the PAT as a Colab Secret:
-
On Colab:
import colab_assist as A
-
Install → experiment → push → resintall:
# Install your private package A.install("$my_token@me/my_pkg@feat/foo") # Experiment from my_pkg import foo foo() # Update the repo # Reinstall updated package A.install("$my_token@me/my_pkg@feat/foo") # Reimport updated functions/classes without needing to restart Colab session foo = A.reload(foo) foo()
-
Or clone → experiment → push → pull:
# Clone your private package and automatically add it to `sys.path` A.clone("$my_token@me/my_pkg@feat/foo", x="p") # Experiment from my_pkg import foo foo() # Update the repo # Pull the update A.pull("my_pkg") # Reimport updated functions/classes without needing to restart Colab session foo = A.reload(foo) foo() # Or restart the Colab session with `sys.path` automatically recovered A.restart() from my_pkg import foo # Immediately importable! foo() # Terminate the Colab runtime with your clones automatically cleaned up A.end()
-
Text file creation and editing
# Create `foo.txt` at working directory and call `google.colab.files.view()` to edit it
A.edit("foo.txt", x="c")
Dependencies & Installation
-
Although currently colab-assist lists no dependencies, it is intended to only be installed and used in a Google Colab environment. The reason not to explicitly list dependencies for now is that at least one depedency (
google-colab) is bespoke for Colab and not hosted on PyPI. However, colab-assist is designed to install and run just fine on a fresh Colab instance. -
You can install colab-assist very quickly with pre-installed uv on Colab:
!uv pip install --system -q colab-assist
Or with pip:
%pip install -q colab-assist
License
Acknowledgements
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
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 colab_assist-0.2.0.tar.gz.
File metadata
- Download URL: colab_assist-0.2.0.tar.gz
- Upload date:
- Size: 59.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6d254bbf691a2ef1443b95cf239d602cc19957c24a25c79d5690e62ac30fadc4
|
|
| MD5 |
cd92731dd3fdfafe1e9dfc8ebf8f788e
|
|
| BLAKE2b-256 |
4d4b4fb475da79c3718d588a461067bf5b4a3e674f57d0a44e5306fd0769ae1e
|
File details
Details for the file colab_assist-0.2.0-py3-none-any.whl.
File metadata
- Download URL: colab_assist-0.2.0-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bcaf5f8870e273670a7552c476a8c5eb33b266c785dc6eb71089f940abae90e
|
|
| MD5 |
40b894fd600072ef7ea187678a94bf05
|
|
| BLAKE2b-256 |
c36a0e3be5b50d673f51a4ab0226fbc08f8fe12d8172da6818315c0cfd4e65c9
|