Module 06 — Python & uv
🎯 Goal: Install Python (via uv) and understand what a "project" is, so Claude Code's automations have a place to live and run. ⏱️ Time: ~1 hour.
What is Python? What is uv?
- Python is a programming language. Most of the automations Claude Code builds for you will be written in Python because it's great at exactly your kind of work: files, spreadsheets, PDFs, and data.
- uv is a modern tool that handles the annoying parts of Python for you: installing Python itself, creating projects, and adding the extra pieces ("packages") a project needs.
Why uv and not the usual jumble? Traditionally Python involves a confusing stack of tools (pyenv, pip, venv, virtualenv...). uv replaces all of them with one fast, friendly tool. Less to learn, fewer ways to get confused. This is the single biggest favor you can do yourself as a beginner.
You do not need a separate "Python version manager" (like pyenv) — uv installs and manages Python versions itself. One tool. Done.
Install uv
One line, thanks to Homebrew:
brew install uv
Confirm:
uv --version
A version number means success.
Install Python (with uv)
uv python install 3.12
This downloads Python 3.12 (a current stable version — any recent 3.x is fine; use whatever's current when you read this) and sets it up. You don't have to think about where it goes or how it's configured — uv handles it.
The key concept: a "project" is just a folder with a recipe
When you do real work, you won't run loose commands — you'll make a project. A Python project is simply a folder containing:
- Your automation code
- A small file (
pyproject.toml) listing what "ingredients" (packages) the project needs - An isolated Python setup just for that project, so projects never interfere with each other
uv creates and manages all of this. You mostly just say "make me a project" and "add this ingredient," and Claude Code handles the rest.
pyproject.toml listing the packages it needs, and its own isolated Python so projects never clash. uv builds and maintains all of it — you just say "make me a project" and "add this ingredient."Hands-on: create your first Python project (25 min)
1. Make a project:
cd ~
uv init my-first-project
cd my-first-project
code .
In VS Code's Explorer you'll now see files uv created, including:
main.py— a starter Python filepyproject.toml— the "ingredients list"README.md— notes about the project
2. Run the starter program:
uv run main.py
It prints Hello from my-first-project!. That's Python running. The first time,
uv quietly sets up the project's isolated Python behind the scenes — that's why
it might pause a moment.
3. Add an "ingredient" (a package). Most automations need extra tools. For
example, openpyxl lets Python work with Excel files:
uv add openpyxl
Look at pyproject.toml in VS Code — openpyxl now appears in the dependencies
list. uv downloaded it and recorded it. When you share or rebuild the project
later, uv knows exactly what it needs.
You won't memorize package names. When you tell Claude Code "read this Excel file," it knows it needs
openpyxl(orpandas, etc.) and runsuv addfor you. You're learning the concept so you understand what it's doing.
The 4 uv commands you'll actually use
| Command | What it does |
|---|---|
uv init NAME |
Create a new project folder |
uv add PACKAGE |
Add an ingredient the project needs |
uv run FILE.py |
Run a Python program |
uv run python |
Open Python to type commands live (rarely needed) |
That's genuinely it for daily use.
How this connects to Claude Code
Here's the workflow you're building toward:
- You make (or ask Claude Code to make) a project folder with
uv init. - You run
claudeinside it. - You describe what you want.
- Claude Code writes Python files, runs
uv addfor any packages, and runs the program withuv run— all itself. - You watch it work and check the results.
So you'll rarely type these commands by hand. But now, when you see Claude Code do it, you'll understand it instead of seeing magic. Understanding = control.
✅ You're done with this module when
uv --versionworks and you've installed Python 3.12 via uv.- You created a project with
uv initand ran it withuv run main.py. - You added a package with
uv addand saw it appear inpyproject.toml. - You can explain, simply, what a "project" and a "package" are.
Next: Module 07 — Claude Code Setup. The main event.