Posts tagged: python

All posts with the tag "python"

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

nvim-manager

I recently built a cli application as a nearly-one-shot-app called nvim-manager. It manages your nvim dotfiles install.

screenshot-2025-01-31T21-21-40-707Z.png

nvim-manager allows you to install pinned versions of your dotfiles, your friends dotfiles, and distros in ~/.config. This allows you to have stable versions that will not break installed while you change things.

...

one-shot-s3-cleanup

So I made a mistake in an app I am working on and ended up creating thumbnails of thumbnails, and thumbnails of thumbnails of thumbnails… etc. I was able to delete them all, but I wanted to make a one-shot script to do it.

I got the idea of the one shot app from Simon Willison and replicated his setup in a chatgpt project

a mistake was made in my s3 bucket and I've created a bunch of extra files write a script that deletes all files that contain _thumb_thumb ⬢ [devtainer] ❯ aws s3 ls s3://dropper 2024-12-29 14:32:32 16158 02271f4c-be18-4bea-b23e-d00f9fe42b9f.webp 2025-01-11 14:20:49 2878 02271f4c-be18-4bea-b23e-d00f9fe42b9f_thumb.webp 2025-01-11 14:21:17 2858...

...

Great list of 4 tips for running fastapi applications.

Fat routers with all of the logic built in makes them hard to test, hard to refactor, causes lots of duplication, and makes it hard to reuse the business logic code later in something like a cli application.

I really like this advice! He reccommends deploying as early as you can get a healthcheck live in your application. I’ve found too many times developers build something that is really hard, or impossible to deploy, when if they had tried to deploy early they would have spotted some easy to fix issues. This is less important if you are building out of a template that your team commonly deploys from, but very important with new patterns.

I’ve kinda fallen out of using direnv now that a lot of my projects use hatch, I generally just hatch shell into them. I just need to make sure I go through all of them and make my installer uv. Now I’ve been thinking about making uv my only needed dependency to run a python project and leaning more to something like uv run --with . uvicorn myapp --reload

thoughts 0.0.4

This is such an improvement to the backend of my website it warrants a blog post of celebration. For far too long I’ve been dealing with a tiny ass edit form on thoughts. I tend to not edit them, and try to get them right in one go. This is kinda the point of a thought, its a quick post meant to be the size of a tweet, but sometimes I’m leaving thoughts on a video or long post and want to make sure I have a good save point, but I just keep the thing in draft and hope I don’t loose if for far too long.

Let’s see this change in action!!

This is the tiny ass form nested deeply in the flow of the feed. When I made it I naively just swapped out the post itself with the edit form, and swapped the post back in after edit.

...

I’ve been playing with 3d printing some items through the slant3d api. I’ve been pricing out different prints by running a slice request through their api.

I’ve been using uv for project management. It’s been working well for quick projects like this while making it reproducible, I’m still all in on hatch for libraries.

mkdir slantproject cd slantproject uv init uv venv . ./.venv/bin/activate uv add httpx rich python-dotenv

Get an api key #

You will need an api key from the slant api, which currently requires a google account and a credit card to create.

# .env # replace with your api key from https://api-fe-two.vercel.app/ SLANT_API_KEY=sl-**

slicing an stl with teh slant api #

Then you can run the python script to price out your print. I’m not exactly sure how this compares to an order, especially when you add in different materials.

SQLModel models ship with an is_, and is_not that you can use to compare to None without pesky linters complaining.

This comment summed it up quite well.

I believe this is concerned entirely with SQLAlchemy, not with SQLModel, and has to do with the required semantics to construct a BinaryExpression object. Hero.age == None evaluates to a BinaryExpression object which is eventually used to construct the SQL query that the SQLAlchemy engine issues to your DBMS. Hero.age is None evaluates to False immediately, and not a BinaryExpression, which short-circuits the query no matter the value of age in a row. From a cursory search, it does not seem that the is operator can be overridden in Python. This could help explain why the only possibility is by using the == operator, which can be overridden.

so rather than using Team.heros == None we can use Team.seros.is_(None) which checks for itentity not equality.