python-script
SolidWrite standalone single-file Python scripts using PEP 723 inline metadata and uv. Use when creating a quick CLI script that needs dependencies without a full project.
Data & Documents 4 stars
1 forks Updated yesterday MIT
Install
Quality Score: 80/100
Stars 20%
Recency 20%
Frontmatter 20%
Documentation 15%
Issue Health 10%
License 10%
Description 5%
Skill Content
# PEP 723 Standalone Python Scripts
Write single-file Python CLI scripts with inline dependency metadata (PEP 723) executed via `uv run` — no virtualenv, no `pyproject.toml`, no project scaffolding required.
## When to Use
- Agent scratch scripts (store in `.agents/tmp/`).
- Any situation where a full Python project is overkill.
- Quick automation, data processing, or one-off CLI tools.
## Template
Base every script on [script.py](references/script.py). Key elements:
1. **Shebang + PEP 723 block** (must be at the top of the file):
```python
#!/usr/bin/env -S uv run --quiet --script
# /// script
# requires-python = ">=3.14"
# dependencies = [
# "rich>=15.0.0",
# "typer>=0.27.0",
# ]
# ///
```
1. **CLI framework**: Use `Typer` with `Rich` for argument parsing and formatted output.
1. **Dual consoles**: `Console()` for stdout results, `Console(stderr=True)` for logs/errors.
1. **Typed arguments**: Use `Annotated[..., typer.Argument/Option(...)]` with help text.
1. **Error handling**: Catch exceptions at the CLI boundary with `err.print_exception(show_locals=False)` and exit via `raise typer.Exit(code=1) from None`; never render locals because they can contain secrets.
## Execution
```bash
# Direct execution (after chmod +x)
./script.py input.txt
# Or via uv explicitly
uv run script.py input.txt --verbose
```
`uv` resolves and caches the declared dependencies automatically — no manual install step.
For a durable script, commit its ...
Details
- Author
- fmind
- Repository
- fmind/dotfiles
- Created
- 4 months ago
- Last Updated
- yesterday
- Language
- Go
- License
- MIT
Integrates with
Similar Skills
Semantically similar based on skill content — not just same category
AI & Automation Listed
tool-uv
Use uv for fast Python dependency sync, environment management, and command execution. Trigger for Python setup, install, lint, test, and script workflows in this repo.
0 Updated yesterday
niksavis Data & Documents Listed
uv
how to run python files and mangage dependencies using UV package manager (pip replacement)
0 Updated 6 days ago
YoniChechik AI & Automation Solid
python-env
Fast Python environment management with uv (10-100x faster than pip). Triggers on: uv, venv, pip, pyproject, python environment, install package, dependencies.
414 Updated today
aiskillstore