What problem does it solve?
This Skill simplifies Python script development by enabling self-contained, reproducible scripts with inline dependency management using uv and PEP 723. It eliminates the need for separate requirements.txt files, making scripts easier to share, execute, and maintain.
Core Features & Use Cases
- Inline Dependency Management: Define Python dependencies directly within your script using PEP 723 metadata, ensuring consistent execution environments.
- Self-Executable Scripts: Create scripts that automatically install their dependencies upon first run, streamlining distribution and setup.
- Best Practices & Patterns: Learn production-ready patterns for security, error handling, CLI applications, and API clients, ensuring robust and maintainable utilities.
- Use Case: Develop a small utility to check server health. Instead of managing a virtual environment and
requirements.txt, embed httpx and rich directly in the script. Share the single file, and anyone can run it without manual setup.
Quick Start
#!/usr/bin/env -S uv run --script
/// script
requires-python = ">=3.11"
dependencies = [
"httpx>=0.27.0",
"rich>=13.0.0",
]
///
import httpx
from rich import print
response = httpx.get("https://api.github.com")
print(f"[green]Status: {response.status_code}[/green]")