python-uv

Run Python scripts with automatic dependency management via uv.

Updated Mar 27, 2022
One-click install
npx skills add https://github.com/emliunix/home.conf --skill python-uv-emliunix
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: python-uv
Source: https://github.com/emliunix/home.conf/tree/main/skills/python-uv
Command: npx skills add https://github.com/emliunix/home.conf --skill python-uv-emliunix

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This skill enables running Python scripts without polluting the system Python by managing dependencies automatically, either by embedding dependencies inline (PEP 723) or by using uv run --with for existing scripts.

Core Features & Use Cases

  • Inline dependencies for new or redistributed scripts, enabling self-contained tools.
  • uv run --with to execute existing scripts with missing dependencies without modification.
  • Templates for common script types (CLI tools, data processing, API clients) to accelerate distribution and portability.

Quick Start

Run a Python script with automatic dependency management using uv.

Frequently Asked Questions about python-uv

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run a Python script with dependencies without installing them globally?

You can run a Python script with automatic dependency management using uv. By embedding dependencies inline via PEP 723 or executing with uv run --with, the script runs in an isolated environment, preventing system Python pollution without requiring manual package installation.

What is PEP 723 inline metadata for self-contained Python scripts?

PEP 723 inline metadata is a standard for embedding dependency declarations directly within Python scripts. It enables self-contained scripts and templates for CLI tools, data processing, and API clients by declaring required packages in a metadata block, allowing the script to be easily distributed and run portably.

Can I execute an existing Python script with missing dependencies without modifying it?

Yes, you can execute an existing Python script without modification by using the uv run --with command. This workflow automatically resolves and injects the missing dependencies at runtime, allowing you to quickly test or execute scripts without altering their original source code.

Does uv run work for creating portable CLI tools and data processing scripts?

Yes, uv run supports creating portable CLI tools and data processing scripts. It provides templates for common script types and uses inline dependency management to ensure your scripts are self-contained, enabling rapid distribution and execution across different environments without conflicts.

Why should I use uv run instead of virtual environments for quick Python scripting?

You should use uv run for quick Python scripting to bypass the overhead of creating and activating virtual environments. It automatically handles dependency resolution and isolation on the fly, preventing system Python contamination while accelerating the testing and execution of self-contained scripts.