Claude Code for Everyone

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.


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 file
  • pyproject.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 (or pandas, etc.) and runs uv add for 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:

  1. You make (or ask Claude Code to make) a project folder with uv init.
  2. You run claude inside it.
  3. You describe what you want.
  4. Claude Code writes Python files, runs uv add for any packages, and runs the program with uv run — all itself.
  5. 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 --version works and you've installed Python 3.12 via uv.
  • You created a project with uv init and ran it with uv run main.py.
  • You added a package with uv add and saw it appear in pyproject.toml.
  • You can explain, simply, what a "project" and a "package" are.

Next: Module 07 — Claude Code Setup. The main event.