# Using Uv

> Python package and project management with UV. Use when creating Python scripts, initializing projects, or managing dependencies. Use when this capability is needed.

- Skill: `tomevault-io/using-uv` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/using-uv`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/using-uv/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/using-uv

---


# UV

UV is a fast Python package manager. Two modes:

## Scripts vs Projects

**Use scripts when:**
- Single .py file
- Quick utility, one-off task
- No shared dependencies across files

**Use projects when:**
- Multiple files, modules, or packages
- Team collaboration
- Need reproducible environments
- Building a library or application

## Scripts

Standalone Python files with inline dependencies (PEP 723).

```python
#!/usr/bin/env -S uv run --script
# /// script
# requires-python = ">=3.12"
# dependencies = ["requests", "rich"]
# ///

import requests
from rich import print
```

Run: `uv run script.py`

See [references/scripts.md](references/scripts.md) for full guide.

## Projects

Structured Python with pyproject.toml and lockfile.

```bash
uv init myproject
cd myproject
uv add requests
uv run python main.py
```

Key files:
- `pyproject.toml` - metadata and dependencies
- `uv.lock` - exact versions for reproducibility
- `.python-version` - Python version

See [references/projects.md](references/projects.md) for full guide.

## Common Patterns

```bash
uv run pytest                     # Run in project env
uv add --dev pytest               # Dev dependency
uvx ruff check .                  # One-off tool execution
uv run --with rich script.py      # Script with ad-hoc dep
```

---
> Converted and distributed by [TomeVault](https://tomevault.io/claim/lexler) — claim your Tome and manage your conversions.
<!-- tomevault:4.0:skill_md:2026-04-11 -->

