Skip to content
Back to skills

Python Scripts

ASecurity

Use when writing standalone Python scripts (one-off scripts, utilities, not part of a larger Python project with pyproject.toml or setup.py). Provides UV shebang template and best practices.

  • 81 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added September 8, 2026
toolspythonbashgitapi

Works with

  • cli
  • api

Security analysis

A100/100

Scanned September 8, 2026

npx -y skills add edmundmiller/dotfiles --skill python-scripts --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Python Scripts?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Python Scripts
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/edmundmiller-python-scripts/badge)](https://www.skillsdirectory.com/skills/edmundmiller-python-scripts)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: python-scripts
description: Use when writing standalone Python scripts (one-off scripts, utilities, not part of a larger Python project with pyproject.toml or setup.py). Provides UV shebang template and best practices.
---

# Standalone Python Scripts

## UV Shebang Template

For standalone Python scripts, always use the UV shebang format:

```python
#!/usr/bin/env -S uv run --script
#
# /// script
# dependencies = [
#   "requests",
#   "click",
# ]
# [tool.uv]
# exclude-newer = "2025-08-23T00:00:00Z"
# ///

import requests
import click

# Your script code here
```

## Key Points

- **Self-contained:** All dependencies declared in the file
- **No virtual env needed:** UV handles dependencies automatically
- **Execution:** Run directly with `uv run script.py` or `./script.py` (if executable)
- **Date pinning:** The `exclude-newer` ensures reproducible builds
- **PEP 723 compliant:** Uses the inline script metadata standard

## When to Use

✅ **Use this for:**

- One-off automation scripts
- CLI utilities
- Data processing scripts
- Quick prototypes
- Scripts without a containing project

❌ **Don't use this for:**

- Files in a project with `pyproject.toml` or `setup.py`
- Modules meant to be imported
- Production services/applications

## Example Script

```python
#!/usr/bin/env -S uv run --script
#
# /// script
# dependencies = [
#   "httpx",
#   "rich",
# ]
# [tool.uv]
# exclude-newer = "2025-08-23T00:00:00Z"
# ///

import httpx
from rich import print

def main():
    response = httpx.get("https://api.github.com")
    print(f"Status: {response.status_code}")

if __name__ == "__main__":
    main()
```

## Making Scripts Executable

```bash
chmod +x script.py
./script.py  # Run directly
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.