I run tailwind for my personal blog, whenever I update it, pre-commit goes in and fixes end of file. I’m sick of these things fighting each other, since it is a generated app it is going to et ignored from pre-commit from now on.
Posts tagged: python
All posts with the tag "python"
python bindings for valkey, forked from redis.
one notable difference I see from redis is that you can install with libvalkey to autmatically get faster parsing support.
For faster performance, install valkey with libvalkey support, this provides a compiled response parser, and for most cases requires zero code changes. By default, if libvalkey >= 2.3.2 is available, valkey-py will attempt to use it for response parsing.
markata search
A side effect of Markata DidYouMean is that we are able to implement some rudimentary search based on slug, title, tags, and description.
...
Markata DidYouMean
Coming in Markata 0.9.1 is far better documentation. i.e. Documentation that actually exists for everything. As part of poking around I realized that I often go to look up the docs for a plugin and forget that the path is /markta/plugins/feeds, sometimes I might try /markata/feeds or /plugins/feeds.py or /feeds or I might even forget the plugin name exactly and try something like feed and get a 404. So I added a didyoumean plugin to markata that takes care of this.
I made a quick recording of this early feature, pay close attention to the url as it...
...
I came accross from_attributes today it allows creation of pydantic models from objects such as a sqlalchemy Base Model or while nesting pydantic models. I believe in the past I have ran into some inconsistencies with nesting pydantic models and I’ll bet one had from_attributes set and another did not.
Arbitrary class instances¶ (Formerly known as “ORM Mode”/from_orm).
Pydantic models can also be created from arbitrary class instances by reading the instance > attributes corresponding to the model field names. One common application of this functionality is integration with object-relational mappings (ORMs).
To do this, set the from_attributes config value to True (see the documentation on Configuration for more details).
...
Really good listicle of new modern top python libraries from 2024. Very well done article with images, links, and an actually quality listicle with many things I’ve never even heard of.
Good overview of seaborn color palettes. They have all sorts of different types, some designed to purposfully give each color the same weight for catecorization. Some designd to give linear differences in value, some have a parabolic feel with a diverging nature.
I fixed lists in my blog
A small improvement to my blog today. I was checking out my /now post and noticed that lists have left padding but no discs or numbers. I popped open my tailwind/app.css added these lines and rebuilt.
#post-body li { @apply list-disc; } #post-body ol { @apply list-decimal; }
And rebuild, which I actually do with ⭐ casey...
...
nvim-manager
I recently built a cli application as a nearly-one-shot-app called nvim-manager. It manages your nvim dotfiles install.
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...
...
Gitingest has a python package on pypi that you can run with uvx, and it accepts the same arguments as the web version, right in your terminal
kitze hating on python packaging in new ways. Python packaging has a lot of quirks that can make it infuriating. Not once have I thought “you know what this needs, quotes and braces”
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.
This is really interesting, the lazy uv scripts are really becoming quite appealing, especially for something like this to just pop out of an llm ready to run. The article features several examples of these one-shot prompt ideas that I suggest you give a try, and a prompt for creating them.
PEP 723 is what is inspiring all of these lazy self installing python scripts, Authored by the author of hatch and pyapp. This is a really cool thing that uv has picked up and made python packaging just a bit easier.. maybe… dependency resolution still sucks.
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
I really like Trey’s steps to making an executable python script with uv
his old process seems to be the same with a new shebang
And here is the new format the the shebang followed by the metadata comment block defined in PEP 723.
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.
...
Nice example of adding a healthcheck to fastapi, and integrating it with docker. Don’t forget to include curl in the install, nice touch.
Simple, modern and high performance file watching and code reload in python.


