Skip to main content

Colab Client

Note: This is an unofficial client and is not affiliated with Google. Use at your own risk.

Python client for Google Colab. Execute code on Colab runtimes from your terminal or Python scripts.

Installation

Install uv:

curl -LsSf https://astral.sh/uv/install.sh | sh

Clone and run:

git clone https://github.com/sachnun/colab-client.git
cd colab-client
uv sync
uv run colab-client

Usage

Command Line

$ uv run colab-client --help
usage: colab-client [-h] [-v] [-c CODE]
                    [--variant {DEFAULT,STANDARD_GPU,PREMIUM_GPU,TPU,CASCADE_LAKE,SKYLAKE}]
                    [--unassign] [--list]
                    {auth} ...

positional arguments:
  {auth}
    auth                Authentication commands

options:
  -h, --help            show this help message and exit
  -v, --verbose         Enable verbose logging
  -c CODE, --code CODE  Execute code and exit
  --variant             Runtime variant (default: DEFAULT)
  --unassign            Unassign current server and exit
  --list                List current assignments and exit

As a Library

uv add colab-client
from colab_client import ColabClient

client = ColabClient()
client.login()
client.connect()
client.open_session()

result = client.execute("print('Hello from Colab!')")
print(result.stdout)

client.close()

Configuration

Environment variables:

Variable Description Default
COLAB_TOKEN_PATH Path to token cache ~/.colab_token.json

License

MIT License - see LICENSE for details.

Metadata

Release files for colab-client 0.1.4

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-client 0.1.4
File Size Uploaded
colab_client-0.1.4.tar.gz 61.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for colab-client 0.1.4
File Interpreter ABI Platform
colab_client-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 76.3 kB

Release files / colab_client-0.1.4.tar.gz

Download URL colab_client-0.1.4.tar.gz
Size 61.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1b7cfa944b074d669a3162c4d41266b8156308af43da1718019546c5825f5a53
BLAKE2b-256 checksum
How to use checksums
4bd1846c1f3489ecb862b10892d5bc3342a7deb51f071463688bdc3db7a53abc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / colab_client-0.1.4-py3-none-any.whl

Download URL colab_client-0.1.4-py3-none-any.whl
Size 15.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6bbfa9901fbb839613cc09e0bcb607eaa06acf5db85fe2e19c091b91291b8b1b
BLAKE2b-256 checksum
How to use checksums
ecc8df44d752a7bc117071e03ca371ffcc2b49d3452fdc8c998e362f63575f02
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.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