Skip to content

T3 API : API Scripts

Matt Frisbie edited this page Jul 11, 2025 · 7 revisions

API Scripts

Running Python Scripts with UV

Inline Packages

Declaring script dependencies

This lets you declare your dependencies at the top of the script using special comments. When run with uv run example.py, uv automatically resolves and installs those dependencies in an isolated environment.

  # /// script
  # dependencies = [
  #   "t3api-utils",
  # ]
  # ///

  from t3api_utils.main.utils import (get_authenticated_client_or_error,
                                      pick_license)

  api_client = get_authenticated_client_or_error()
  license = pick_license(api_client=api_client)
  print(license)

Virtual Environments

You can install dependencies into a standard Python virtual environment managed by uv venv:

uv venv
source .venv/bin/activate
uv pip install t3api-utils
python example.py
  from t3api_utils.main.utils import (get_authenticated_client_or_error,
                                      pick_license)

  api_client = get_authenticated_client_or_error()
  license = pick_license(api_client=api_client)
  print(license)

T3 Python Libraries

T3 supports various Python packages to make using the API easier:

t3api

t3api GitHub repository

t3api is a wrapper around the entire T3 API. It allows you to authenticate and send requests in a structured way without needing to manually build HTTP requests.

t3api-utils

t3api-utils GitHub repository

t3api-utils is a collection of pre-built utilities for solving common patterns. Utilities include automatic authentication, license selection, and loading entire collections in parallel.

t3py

t3py GitHub repository

t3py is a command line program with prebuilt commands. It can be run with t3py [<command_name>].


Next Steps

Sidebar

Clone this wiki locally