Posts tagged: python
All posts with the tag "python"
!https://uvx.sh/
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 d...
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 Techbrophobic. It’s better than the non believers will tell you, and no where near as good as the hype bros will tell you. The industry is shitty and doing shitty things, I’m not here to change this, I’m here to do my thing and try to get better.
...
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.
...
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': len(post.title), 'title': post.title, 'slug': post.slug} for post in m.posts] lens_sorted = sorted(lens, key=lambda x: x["length"]) groups = { k: list(g) for k, g in groupby(lens_sorted, key=lambda x: (x["length"] // 5) * 5) } posts = [g[0] for g in groups.values()] ogs = [ f'[![{post["title"]}](https://shots.waylonwalker.com/shot/?url=https://waylonwalker.com/{ post["slug"] }/og/&height=600&width=1200&scaled_width=1200&scaled_height=600&format=jpg&v=4)](https://waylonwalker.com/{ post["slug"] }/og/)' for post in posts] print("\n\n".join(ogs))
OG-Sample
...
!https://simonwillison.net/2025/Dec/9/deprecations-via-warnings/#atom-everything
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.
...
setting env var to a number greater than 0 will make the terminal resize to that number of columns.
I found an interesting side effect of manually running my script to generate stars posts is that you get notified whe...
Today I learned how to use AliasChoices with pydantic settings to setup common aliases for the same field. I'm bad ab...
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!
...
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
...
I often want to run an s3 sync in an isolated environment, I don't want to set any environment variables, I don't wan...
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.
FastAPI is a modern and efficient web framework for Python, built on top of the Starlette web framework, and pydantic...
Starlette has a head request that works right along side your get requests. This morning I fiddled around with custom...
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.
...
!https://www.youtube.com/watch?v=-Z-BDux-TRk
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