python

60 posts

Staticware 0.2.0: The first cut

This is an early release. Staticware does something very satisfyingly today: it serves static files with content-hashed URLs for cache busting. That means when you edit your CSS then redeploy and restart your server, visitors get the latest CSS without forcing a refresh. More will come.

BinaryOrNot 0.6.0: Three Layers of Detection

BinaryOrNot identifies binary files three ways: by extension, by file signature, and by content analysis. Pass it any file path and it tells you binary or text, accurately, across PNGs, PDFs, executables, archives, fonts, CJK-encoded text, and hundreds of other formats.

Cookiecutter 2.7.1: The One Where It Knows Its Own Name

You know that thing where you release an album, it's on the shelves, people are buying it, and then someone points out the spine says it's your previous album? That's what happened with Cookiecutter 2.7.0. We put out the long-awaited release with 27 improvements and 17 contributors, and cookiecutter -V proudly announced: **2.6.0**.

Adopting Idiomatic PyTest: A Code Review

We recently reviewed a pull request from contributor Martin Saizar that refactored our Python tests. The goal was to enable the PyTest (PT) linter rule in Ruff, our code formatter and linter.

The First Air Sprint

I co-led the first ever Air web framework sprint in Davao, Philippines, as part of Day 2 of PyCon Davao on October 26, 2025.

Pi

Happy Pi Day. Here's pi from the stdlib math module and from Numpy.

Excavating a Lost CLI Tool

I thought I had completely lost my new iteration on my notebook titler tool, but it turns out I'm finding bits and pieces in various places. Here I try to put it together again.

Text Embeddings and Cosine Similarity

I use Gemini's text-embedding-004 model to generate embeddings for sentences. Then I define a cosine similarity function and see what it returns for a few related and unrelated sentences.

Genanki and fastcore

Working with Anki flashcard decks in Python, with genanki to work with the decks and fastcore for ease of use.

Understanding FastHTML Routes, Requests, and Redirects

In this tutorial we'll look at the simplest routes and route handlers you can create with FastHTML. We'll define the handlers as little functions, and then call them as we would any other Python function. After that, we'll make simple GET requests to a simple index route/handler, a parameterized one, and a parameterized one with a redirect.

Using zip

The zip docs say that zip(*iterables, strict=False):

What Can `execnb` do?

This notebook is a SolveIt-style exploration of https://github.com/AnswerDotAI/execnb/. Here I am following the SolveIt process in a Jupyter notebook to learn new things.

Deck the Halls

Having fun with fastcore's L (list) class and holiday lyrics.

Daddy's Snowman Card

Here we are checking the numbers from our daughter's snowman card to Daddy. She gave him math problems to solve and a snowman joke.

Setting Up a Blog With nbdev

I feel like Jupyter notebooks would be really nice for blogging or publishing "Today I Learned" posts. I had heard about Fastpages before via Jeremy Howard's blog or YouTube videos, but seeing that it was deprecated in favor of nbdev, I decided to try nbdev.

Voronoi Mandalas

SciPy has tools for creating Voronoi tessellations. Besides the obvious data science applications, you can use them to make pretty art like this:

Our Trip to DjangoGirls Ensenada, Mexico

This weekend, Daniel and I drove down to Ensenada, Mexico to speak and coach at DjangoGirls Ensenada. It was a 2-day workshop for women of any level of experience to get a taste of web application development.