Posts tagged: python

All posts with the tag "python"

275 posts latest post 2026-03-31
Publishing rhythm
Feb 2026 | 1 posts

I’ve been a long user of pygments, it’s been the thing that injects <spans> with funny little class names like sc and si into the code blocks of my website. I’ve even gone as far as implementing a plugin for md-it, but I had no idea how to re-style it. I long ago got a theme that looked good enough from somewhere and just used it, maybe I pulled something from their docs site and forgot. Today I learned you can list all the themes easily from the library itself, and render out new css.

from pygments.styles import get_all_styles list(get_all_styles()) # [ # 'abap', # 'algol_nu', # 'algol', # 'arduino', # 'autumn', # 'borland', # 'bw', # 'colorful', # 'default', # 'dracula', # 'emacs', # 'friendly_grayscale', # 'friendly', # 'fruity', #...

markata parallel render

_._ __/__ __ __ _/_ Recorded: 07:53:56 Samples: 71681 /_//_/// /_\ / //_// / //_'/ // Duration: 92.741 CPU time: 91.748 /_/ v4.5.1 Program: /home/waylon/git/waylonwalker.com/.venv/bin/markata build --pdb 92.740 Markata.run markata/__init__.py:443 `- 92.714 HookCaller.__call__ pluggy/_hooks.py:479 [2 frames hidden] pluggy 92.714 PluginManager._hookexec pluggy/_manager.py:106 |- 38.207 wrapper_register markata/hookspec.py:265 | |- 26.105 render plugins/link_collector.py:59 | | |- 10.012 BeautifulSoup.__init__ bs4/__init__.py:122 | | | [14 frames hidden] bs4, html | | |- 5.599 <listcomp> plugins/link_collector.py:181 | | |- 4.050 <listcomp> plugins/link_collector.py:173 | | |- 3.466 Markata.map markata/__init__.py:565 | | |`- 2.092 markata/__init__.py | | `- 0.942 BeautifulSoup.find_all bs4/element.py:2008 | | [2 frames hidden] bs4 | |- 9.107 render markata/plugins/render_markdown.py:260 | |`- 8.902 result_iterator concurrent/futures/_base.py:612 | | [5 frames hidden] concurrent,...

csv

name,age,city Alice,30,New York Bob,25,San Francisco Charlie,35,Chicago Charlie,35,Chicago Charlie,35,Chicago Charlie,35,Chicago Charlie,35,Chicago Charlie,35,Chicago Charlie,35,Chicago name,age,city Alice,30,New York Bob,25,San Francisco Charlie,35,Chicago Charlie,35,Chicago Charlie,35,Chicago Charlie,35,Chicago Charlie,35,Chicago Charlie,35,Chicago Charlie,35,Chicago graph TD A-->B A-->C A-->D D-->E document.addEventListener('DOMContentLoaded', function() { (function() { const ctx = document.getElementById('chartjs-1'); new Chart(ctx, { "type": "bar", "data": { "labels": ["Red", "Blue"], "datasets": [{ "label": "Votes", "data": [12, 19] }] }, "options": { "responsive": true } }); })(); (function() { const ctx = document.getElementById('chartjs-2'); new Chart(ctx, { "type": "line", "data": { "labels": [ 65, 59, 80, 81, 56, 55, 40 ], "datasets": [ { "label": "My First Dataset", "data": [ 65, 59, 80, 81, 56, 55, 40 ], "fill": false, "borderColor": "rgb(75, 192, 192)", "tension": 0.1 }...

David’s design on his blog is fantastic likely from years of small improvements like this converting ugly quotes to pretty quotes and optimizing fonts.

It’s common for markdown libraries to convert the first to the second like my build script does.

This is new to me, I had no idea that markdown libraries did this, I’m now interested if markdown-it does it.

For subsetting I use the fontTools library but I’ve no idea how to setup Python environments. I got it working once and failed to document the process.

...

Copier has a few quirks with vcs that I just discovered by trying to test out some changes. I may have some config that I have long forgotten about somewhere deep in my dotfiles, I don’t think so, but id love to be wrong and corrected, please reach out.

I tried throwing everything at this template to make it work. I tried a bunch of flags that did not work. I tried making commits to the local repo to get rid of the dirty warning. I really wanted to test new changes locally without committing and pushing untested and potentially broken changes.

uvx copier copy ../markata-blog-starter . uvx copier copy gh:waylonwalker/markata-blog-starter@develop . uvx copier copy ../markata-blog-starter . -wlg --trust

What Works - –vcs-ref #

Finally after trying everything to get the local copy to work, and my guess of @branch not working I found this to work. It does require me to go to the repo on my develop branch.

uvx copier copy gh:waylonwalker/markata-blog-starter --vcs-ref develop .

...

The rich console is themeable, I’ve been a long time user of rich and had no Idea. You can define your own theme keywords and use them just like you use normal rich keywords in square brackets like'[bold red]'.

I’m trying to replace my usage of google inline search apps with real apps, today I used a stopwatch to time some things out at work by opening stopwatch. This was something I just wanted running in a tab on another screen, it was not timing running code or anything, I was using it as a reminder to check browser caches every 5 minutes or so for some testing.

So tonight I whipped up a stopwatch, clock and timer, all of which are using the wakelock API to keep the screen on while the app is running.

m9a devlog 1

It’s sad to see textualize.io close the doors, but textual is still alive and maintained as a n open source project. I tried to use it very early, and struggled, this was before docs and tutorials really existed, before a lot of the widgets and components existed. Then as we all do I got busy and moved on to other things in life and did not have the capacity to build TUIs.

I like tuis, I like staying in the terminal. I use lf daily to move files around when I want something more than mv and cp. I use k9s hourly to...

...

fix feed descriptions

Today I fixed a bug in markata that has been occurring for a few months where the description for posts come out as None if coming from cache, the issue was a pretty simple check and pull properly from cache. This fixes all the descriptions in feeds and metadata on the post.

While in there we went ahead and improved our get_description to more accurately return plain text without escaped characters, remove cutoff words, and add an elipsis if the description cuts off the text.

While I was there I made longer form posts, til, blog-post use the super description of 500 characters instead of the regular 120 character description.

I’ve been using ruff to lint my python code for quite awhile now, I was pretty early to jump on it after release. Some of my projects have had a nice force-single-line setting and some have not. I dug into the docs and it was not clear what I needed to make it work.

[tool.ruff] select = ['I'] # you probably want others as well [tool.ruff.isort] force-single-line = true

Turns out I was missing Isort in the select list.

Astral is doing great things in the python industry. They are disrupting entire categories of tools with extremely fast, easy to use, and feature rich alternatives that make it really hard to keep using the incumbent. So far I am seeing no signs of evil, sometimes with such a disrupter there is some sort of downside that make it hard to want to do the switch. In the interview they even mention things like leaning on lsp so that it works across all editors rather than building out vscode integrations that work for most developers. As a neovim user I greatly apreciate this.

ty, has a playground running at types.ruff.rs. You can edit code in there and see what the type checker results would be in browser. This looks good, excited to see it running in my lsp.

Here is an example where a Optional may not be defined.

Checking for existance before using it resolves the issue.

I was looking back at my analytics page today and wondered what were my posts about back at the beginning. My blog is managed by markata so I looked at a few ways you could pull those posts up. Turns out it’s pretty simple to do, use the markata map with a filter.

from markata import Markata m.map('title, slug, date', filter='date.year==2016', sort='date')

Result #

[ ('⭐ jupyterlab jupyterlab',...

...

Astral is working on some great things around python, they have created a high standard for python tooling built on rust that works really well, runs fast and covers everything in the space it resides in. ty appears to be their linter coming soon.

portal-platformer-devlog-1

Here is the current state of my platformer yet to really be named, I want to make something in between hollow knight and portal.

I made one once in make code arcace on a pybadge. It was quick and dirty, but fun to work on. It had the basic of blocks that I could move, blocks i could put a portal onto, and a goal for each level. Some levels you can just walk through and some levels required you to really think about where to place the portal.

So this version of the game is a least 2 years in the making, I open it every few months give it a day or two and move on. Its mostly something that I work on with my son. He really likes to jump around on projects so its hard to make real progress on something, but we are hitting an age where he is able to come back to projects a little better.

...

I think I’m getting really close to having a good workflow setup for using pyapp. Such an amazing project to allow developers to create applications in python without passing on the hassle of python and managing installs to the user.