Posts tagged: python

All posts with the tag "python"

266 posts latest post 2026-03-31
Publishing rhythm
Jan 2026 | 3 posts

astral silently dropped a clever uvx.sh to help builders reach a wider audience, no longer does a user need to have python installed prior to installing a python cli. It does have a hard requirement on having curl or wget available.

I really wish I would have got this right a few years ago. Theres a couple of flags I had to use to get mdformat to do hard wraps at 80 characters and not wreck tables. This mix of flags and plugins is workign really well for me so far.

mdfmt() { uvx \ --with "mdformat-ruff" \ --with "mdformat-beautysh" \ --with "mdformat-web" \ --with "mdformat-config" \ --with "mdformat-gfm" \ --with "mdformat-front-matters" \ --with "mdformat-wikilink" \ --with "mdformat-simple-breaks" \ mdformat \ --wrap 80 \ --end-of-line lf \ --codeformatters python \ --codeformatters bash \ "$@" }

And as pre-commmit.

My First Agentic Workflow

In early 2026 I’m trying to lean more in to agentic workflows. The tools are not only better than they were a year ago, but available to me now unlike they were 6 months ago.

At home I’m using opencode, the tooling here is fantastic. LSP incide of these things is incredible, mcp is fine when its needed. The free models it gives you are impressively good for free models, but they are still not the big models from the big providers. I’m using what work gives me, they give me a tool with access to good models, the models are great, the tools kinda suck. I’m being vaugue here because I dont share real work details.

I’ve been skeptical the whole way, I see ai being a very useful tool. I remain 2 min read

Dont Trust Users Tokens

User states: Upon picking up an old project and trying to install pip says “cannot find a version to satisfy”

I’ve got this, I’ve had this a hundred times before it’s a python version, a rogue package, maybe a yank from the pinned deps. I pop open the project get us on the same commit. I get a different error, make a few updates and we are good, except the user gets the same error from the start.

They never saw the error I did, and my fix did not magically resolve their error. We circle all the things it could be for hours. I consistently wipe my venv, and recreate with ease, send them the commands I ran to no avail. Something is up and I can’t put my finger on it. We’ve checked all the things and inched as close as we can to running everything exactly the same.

...

2 min read

Og-Sample

I’m making an effort to make my og images better yet again, I’m going for that next 10% better. I really like my og images, but there are some title sizes that overflow. This page is a page to help debug. How I make these og images is for another day.

I use my own static site generator markata. I can use it to generate a list of posts wrapped in their og image. I use itertools to do a groupby so that I can do roughly every 5 characters larger, and see a wide variety of sizes.

from markata import Markata from itertools import groupby markata = Markata() lens = [{'length':...

...

1 min read

One Year Of Shots

I’ve been running my shot scraper api for a year now. It creates og images for my website and thumbnails for my Reader using a headless chrome instance.

a histogram of shot counts by day

You can see in the histogram that I’ve had a few big spike days, This has been mostly for days that I’ve integrated into a new service or changed the endpoint. On February 13, 2025 I swapped over from using the post to using template specific to open graph images.

...

2 min read

setting COLUMNS env var to a number greater than 0 will make the terminal resize to that number of columns.

COLUMNS=80 uvx --from rich-cli rich myscript.py

I discovered this when I was trying to make a low effort readme generated from the code, but did not depend on the size of terminal it was ran on.

I found an interesting side effect of manually running my script to generate [[ stars ]] posts is that you get notified when one gets renamed. Today I noticed that Ned Batchelder created a coveragepy org.

Today I learned how to use AliasChoices with pydantic settings to setup common aliases for the same field. I’m bad about remembering these things, and hate looking up the docs. I like things to be intuitive and just do the thing I want it to do. Especially when they get configured through something like yaml and do not have a direct lsp look up right from my editor. I figured out how to support what might be common aliases for a storage directory. These can be set up as environment variables and used by config.

Mcat Anything

I’ve long looked for a way to cat anything in the terminal. I’m am terminally in the terminal. I manage all of my projects, code, website, notes, files, servers, infrastructure, almost everything from the terminal. I occasionally open a file manager, mostly at home, only so that I can browse images.

Compounding my issue, I’m a tmux user. It works great for me, and I barely have to think about it at this point. The keybindings are second nature to me. I can go between server, terminal, nvim, and between projects instantly, no loader, no lag, no animation, it just works for everything that really matters to me for really getting things done.

mcat is a new tool that seems like it can cat anything in the terminal, code, files, images, markdown, markdown with images, and even video, without leaving tmux!

...

2 min read

Missing Thoughts

No one is perfect, this is why we have things like checkpoints or gates in the form of pull requests, linting, type checking, and tests. What happens when you work on small side projects by yourself that try to be content focused? What happens when you end up building a lot of the tech under that site and build it on the bleeding edge of all the tech you make? They are likely missing these things and occasionally there are some periods of regression. This is one reason I really like the term digital garden to describe one’s small corner of the internet where they share their thoughts.

There will be regressions

There were signs, signs I did not notice

...

3 min read

I often want to run an s3 sync in an isolated environment, I don’t want to set any environment variables, I don’t want anything secret in my history, and I don’t want to change my dotenv into something that exports variables, I just want s3 sync to work. dotenv run is the tool that I’ve been using for this, and this uv one liner lets it run fully isolated from the project.

uv tool run --from 'python-dotenv[cli]' dotenv run -- uv tool run --from awscli aws s3 sync s3://bucket data

multi-line #

same thing formatted for readability

uv tool run \ --from 'python-dotenv[cli]' \ dotenv run -- \ uv tool run \ --from awscli \ aws s3 sync s3://dropper data

There are probably 10 ways to skin this cat, but this is what I did, if you have a better way let me know, I’ll link you below.

First 3d Printed Threads

Working on an upcoming project that requires some threaded screws. Trying to keep a low budget on this one with as much to come off of the printer as I can. It might become a slant3d portals product if it works out. I always like making test prints for stuff like this especially to see how the feel is off of the printer that is going to print the final product and take much longer. First try was a success.

I started out looking up standard half inch thread pitch and size, but ran out of time to get the exact profile of a half inch bolt, so I will need to fix that later. Th

The print orientation is critical for strength here. This part is a full 1/2: so it should be strong either way, but to make sure we are printing the bolt horizontally to get nice long print layers. To do this we have to give it a bit of a flat spot on the top and bottom. This does not hurt performance, if anything it probably helps give some room for poor tolerances.

2 min read

FastAPI is a modern and efficient web framework for Python, built on top of the Starlette web framework, and pydantic for data validation and serialization.

FastAPI is a modern, fast (high-performance), web framework for building APIs with Python based on standard Python type hints.

The key features are:

The +5 point increase for FastAPI is one of the most significant shifts in the web framework space. This signals a strong trend towards using Python for building performant APIs and reflects the overall strength of the Python ecosystem.

FastAPI.">Starlette has a head request that works right along side your get requests. This morning I fiddled around with custom routes for GET and HEAD, but had to manually set some things about the file, and was still missing e-tag in the end. Turns out as a developer you can just add a head route to your get routes and starlette will strip the content for you, while preserving all of those good headers that fastapi FileResponse created automatically for you.

...

python extras are for shipping

Python has two ways of adding optional dependencies to your projects pyproject.toml file dependency-groups and optional-dependencies.

for development

Dependency grooups are used when working on the project, they do not ship with the project, users cannot select to install them with the project. These are for things like running tests, linting, or docs. You might want to run these in ci, or keep your dev machines tight. For the most part you can probably keep these in dev. Depending on your team, fluency, and tolerance for slower installs extra packages. Adding too many tight groups might make it hard for the team to remember all the groups and which one to use and end up with them using --all-groups anyways.

...

3 min read

anthony has some of the best python highlight videos each year. This might be a good sign, but each year there seems to be less and less that I am chomping at the bit to get to. I thought the remote debugger looked every interesting, his use case for babi seemed very interesting. I wonder what textual would look like built in a 3.14 world, would it still have built its own debugger/console?

uv tool run --python=3.14 babi

Without a process flag you need sudo permissions to attach a pdb debugger similar to gdb.

Kraft-Coordinates

Handy reference for coordinates in the kraft world.

Overworld:-208 71 -291 Nether:-26 9 -36

Overworld: 209 62 -752 Nether:26 1 -94

1 min read