248 words
1 minutes
003: 🐍 Notes and hints on using 🌞 uv
2025-01-19

I have been using uv since January 1st. In this post, I’ll quickly go through some of my favorite things about uv.

🌞 Getting uv#

It is not necessary to curl into your shell to get the uv executable. πŸš€ There are releases available.

Using uv#

🐍 Python console#

uv run python3

πŸ•ΈοΈ Web server#

uv run python -m http.server uv run python -m http.server 8888

πŸ₯Ί Handling dependencies with --with#

Let’s say you want requests with that Python console

uv run --with requests python3

🧰 Using tools#

uv tool run pastebin-bisque
uv tool run --from mitmproxy mitmweb

If the tool has not been used previously, it will be retrieved automatically and then executed. You can even specify the version to be used.

πŸ“œ Running scripts#

uv run --with argparse,datetime,passgen,faker,requests \ python main.py --no-feature 4 lol.txt dundermifflin.com

πŸ”– That’s an example incantation of faux-credential-dump-generator.

πŸ”­ What’s next?#

I’ll continue using uv in earnest for the rest of the month at least. It has lived up to the promise of being a stand-in replacement for pip and friends. I have yet to find something in my workflow that is not supported by uv. I have not introduced any reliance on β€œuv only” ways of doing things.

My decision on how fully to adopt uv will depend on what path the community follows to an extent. I am rather happy on the road we are on at the moment.

πŸ“š READ more#

003: 🐍 Notes and hints on using 🌞 uv
https://brie.ninja/posts/003/
Author
Brie Carranza
Published at
2025-01-19