Using uv to run Python tools without installing them

Posted on Thu 23 January 2025 in python, uv

I wanted to run a Python tool without installing it, or preparing a virtual environment and all that. This is now very easy with uv, using uvx.

I wanted to run markitdown, a tool to convert various files to Markdown. I didn't want to install it, so I used uvx:

uvx markitdown "file_to_convert.docx" > output_file.md

It downloads the tool and installs it in a temporary, isolated environment.

A tool can be installed with uv tool install, like this:

uv tool install markitdown

It's very convenient.