Skip to main content

Python client for programmatically interacting with Google Colab

Project description

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.

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

colab_client-0.1.4.tar.gz (61.2 kB view details)

Uploaded Source

Built Distribution

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

colab_client-0.1.4-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: colab_client-0.1.4.tar.gz
  • Upload date:
  • Size: 61.2 kB
  • Tags: Source
  • Uploaded using 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}

File hashes

Hashes for colab_client-0.1.4.tar.gz
Algorithm Hash digest
SHA256 1b7cfa944b074d669a3162c4d41266b8156308af43da1718019546c5825f5a53
MD5 d14e86be0c5103c5ad3d54e283d321f8
BLAKE2b-256 4bd1846c1f3489ecb862b10892d5bc3342a7deb51f071463688bdc3db7a53abc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: colab_client-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using 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}

File hashes

Hashes for colab_client-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 6bbfa9901fbb839613cc09e0bcb607eaa06acf5db85fe2e19c091b91291b8b1b
MD5 4b4717443f07023b1a38ba926f8762af
BLAKE2b-256 ecc8df44d752a7bc117071e03ca371ffcc2b49d3452fdc8c998e362f63575f02

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