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.
Posts tagged: python
All posts with the tag "python"
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 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. 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. 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. You will need an api key from the slant api, which currently requires a google account and a credit card to create. 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. Hynek has a sick dockerfile setup for using uv in python projects. SQLModel models ship with an 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 Today I learned that you cannot pass negative integers as values to typer. in this case This new demo of textual is wildly awesome, so many widgets and features being added into the main library. The themes and animations are on point and far surpass my expectations of a tui.uv run --with . uvicorn myapp --reloadthoughts 0.0.4
mkdir slantproject cd slantproject uv init uv venv . ./.venv/bin/activate uv add httpx rich python-dotenv Get an api key #
# .env # replace with your api key from https://api-fe-two.vercel.app/ SLANT_API_KEY=sl-** slicing an stl with teh slant api #
is_, and is_not that you can use to compare to None without pesky linters complaining.Team.heros == None we can use Team.seros.is_(None) which checks for itentity not equality.context_settings={"ignore_unknown_options": True} is required so that the - does not look like a flag.
