Will Smidlein's Blog

Posts tagged "python"

uv: It's Really Good

Basically, they took what was working in pip, rye and poetry, and discarded all the stuff that didn’t work. Then they spent months killing tickets to bring it to an insane level of quality.

This cannot be understated, as such a level of quality and dedication is so extremely rare in software that I usually associate it with things like VLC or sqlite. This is the league I consider uv in.

Always try uv first. If it doesn’t work (which is very rare), go back to what you did before or find a workaround.

If you haven’t played with uv yet, I can’t recommend it enough. Python ecosystem tools come and go but this one feels like it’s got some staying power. Lots of tremendously well thought-out decisions, many of which are laid out in the linked article. No magic, just good abstractions. Such a joy.

I will say I am somewhat confused about who is paying for all of this. Like obviously VCs but uh… why? Definitely not out of the goodness of their hearts. Similar uneasiness around Bun, which I also love.

EV Accounting

I recently leased a Hyundai Ioniq 5. I did not (and do not) need another car, I did not want another car, I just lowballed the hell out of a dealer and was utterly shocked when he said he’d do the deal.

It’s quite nice.

EVs have come a long way since I had my 2019 E-Golf. Public charging infrastructure has somehow gotten… worse? Which I truly did not believe was possible. But alas it’s not something I have to worry about (as much) this time around because I have a home EV charger.

I went with an Emporia mostly because I already have their whole-home energy monitoring and I figured it would tie in nicely. It was also $120 cheaper than the Chargepoint which helped. These things are remarkably simple so it seemed dumb to spend more than the bare minimum.

I have it configured to only charge during my utility’s off-peak hours so the cost is absurdly low- less than 1/10th the cost to drive the equivalent distance in my Subaru.

Alas, it’s not nothing. And therefore it must be accounted for. With gas it’s easy; every time I swipe my credit card at a transaction, I categorize it as “Gas- {car}” in YNAB and then at the end of the month I get a nice tally of how much I spent on gas per vehicle in my fleet.

With EVs, it’s part of the electric bill, and it’s not easily separated out by the utility company (they don’t know if you used your power to charge your EV or to run your oven).

I already have a script that extracts the line items from my utility company’s PDF bills and creates split transactions, so I figured I could simply use the Emporia API to figure out how much I spent on EV charging in that time period and add another line item.

Turns out Emporia doesn’t have an API. Or at least, they don’t have a public one. Luckily somebody has already done the heavy lifting which made adding the EV Charging Report endpoint quite easy.

Now every time I run my script, it will reach out to the Emporia API and ask “how much of this electric bill was EV charging?” and properly categorize.


report = vue.get_ev_charging_report(EVSE_ID, billStartDate, billEndDate)
total_cost = report.charging_cost

description = f"{report.energy_kwhs:.2f} kWh"

What will I do with this information? Absolutely nothing.

Unit Tests In Markdown

I was reading this great post comparing Pyrefly and Ty and the appendix stood out-

I just wanted to call out that ty’s tests are written in… MARKDOWN! How cool is that?

- Edward Li

Very cool indeed!

I did a bit of digging and found the Readme as well.