I Am Reading Fluent Python

I Am Reading Fluent Python

A couple weekends ago, I was lucky enough to attend PyTexas 2025. It’s a great regional conference that is a great mix of world class speakers and cozy relaxed atmosphere. It’s in spring, on the banks of Lady Bird Lake in Austin, Texas. It is a wonderful event. At the conference, the organizers periodically raffled off items from a ‘prize trough’. The prize trough was a wagon filled with technical books. There were many great titles in there including The Pragmatic Programmer, Automate the Boring Stuff with Python, and The Missing README, among others. ...

April 21, 2025 · 2 min · Jamal Hansen

Add External Dependencies to Python Scripts with uv

Ever wanted to share a Python script that uses external packages without making the recipient set up a virtual environment? With uv, you can embed dependencies directly in the script. The Command uv add --script example.py 'requests<3' 'rich' This adds inline metadata to your script: # /// script # dependencies = [ # "requests<3", # "rich", # ] # /// import requests from rich.pretty import pprint resp = requests.get("https://peps.python.org/api/peps.json") data = resp.json() pprint([(k, v["title"]) for k, v in data.items()][:10]) Running It Anyone with uv installed can now run the script directly: ...

April 19, 2025 · 1 min · Jamal Hansen