Setting Up Python¶
You only need a basic knowledge of using the command line to run T3 API Python scripts. This knowledge can be picked up very quickly.
TL;DR¶
- Open the command line
- Install UV
- Install Python:
uv python install - Log in to T3 once:
uvx --from t3api-utils t3api login(see Logging In)
Learning to use the Command Line¶
What is the Command Line?¶
The command line, also called the terminal or shell, is an interface that lets you interact with your computer using text commands. It’s especially useful for running programs like Python scripts without needing a graphical interface.
Opening the Command Line¶
To open the command line:
-
Windows:
- Press
Win + R, typecmd, and hit Enter for Command Prompt. - Or search for "PowerShell" or "Windows Terminal".
-
macOS:
-
Press
Command + Space, type "Terminal", and press Enter. -
Linux:
-
Press
Ctrl + Alt + Tor search for "Terminal" in your application menu.
- Press
Navigating Directories¶
The command line is always "inside" a specific folder on your computer. To run a script, you need to open the terminal in the same folder or navigate to it manually using the cd command.
Open a terminal in the current folder:¶
-
Windows:
- Option 1: Shift + Right-click inside a folder → “Open PowerShell window here”
- Option 2: Type
cmdorpowershellin File Explorer’s address bar - Option 3: Use Windows Terminal from the Microsoft Store
-
macOS:
- Option 1: Right-click in Finder → “New Terminal at Folder”
- Option 2: In Terminal, type
cdand drag the folder into the window
-
Linux:
- Option 1: Right-click in file manager → “Open in Terminal”
- Option 2: Navigate to folder, press
Ctrl + Alt + T
Setting Up Your Environment¶
For beginners, we recommend using Python and UV to interact with the T3 API. All T3 example scripts are written in Python.
Installing UV¶
UV is a Python package and environment manager. It simplifies dependency handling, virtual environments, and even installs Python itself.
- Use the standalone installer
- This method does not require Python to already be installed
Installing Python¶
With UV installed, run:
This installs the latest Python version automatically.
Set Your Terminal Location¶
Before running scripts, make sure your terminal is "in" the folder where the script lives. See Navigating Directories above.
Troubleshooting¶
- Run scripts with
uv run:uv run example.pyinstalls the script's dependencies and runs it with the right Python. You do not need to callpythondirectly. - “uv is not recognized…”: the installer finished but your terminal has not picked up the new PATH. Close the terminal and open a new one.
- “No such file or directory”: your terminal is in a different folder from the script. See Navigating Directories.
- A package is not found: the script's dependency header is missing it. See Inline Packages.
Next Steps¶
- Learn how to write and execute a Python script
- Browse the OpenAPI spec for the exact shape of each endpoint
- Load entire datasets at once with Reports or bring back related metadata in one pass with Supercollections
- Refer to the T3 API documentation to explore all the available endpoints.