autopep723

autopep723 is a tiny wrapper on top of uv run that automatically detects third-party dependencies of Python scripts. Forget about manually managing dependencies for simple experiments!

Quick Start

The easiest way to use autopep723 is via uvx:

# Run directly without installing
uvx autopep723 script.py

To install the tool permanently:

uv tool install autopep723
autopep723 script.py

Features

  • Zero dependencies - uses only Python standard library

  • 🪶 Minimal footprint - perfect as uv run wrapper

  • 🔍 Automatic dependency detection via AST analysis

  • PEP 723 compliant metadata generation

  • 🌐 Remote script support - run scripts directly from URLs

Shebang Integration

You can use autopep723 directly as a shebang:

#!/usr/bin/env -S uvx autopep723
import requests
import numpy as np

# Your script here...

Then running the script will automatically install the required dependencies in an ephemeral environment!

./script.py