RSSAmplifier

Blog

Michael Kennedy's Thoughts on Technology

Essays on Python, technology, programming and more from Michael Kennedy.

mkennedy.codesRSS feed ↗57 posts

Latest posts

What the pls?

🔔 Update (June 30, 2026) Great news, the maintainer, Dhruv Bhanushali (@dhruvkb) , saw this post and is fixing the PyPI confusion. The Rust version is being published to PyPI again, so uv tool , pipx , and uvx will work the way you’d expect. The catch: none of this is live yet. It ships with v7 , which is still in beta, so a plain uv tool install pls today still pulls the abandoned v6, and…

Cutting Python Web App Memory Over 31%

tl;dr; I cut 3.2 GB of memory usage from our Python web apps using five techniques: async workers, import isolation, the Raw+DC database pattern, local imports for heavy libraries, and disk-based caching. Here are the exact before-and-after numbers for each optimization. Over the past few weeks, I’ve been ruthlessly focused on reducing memory usage on my web apps, APIs, and daemons.…

Raw+DC Database Pattern: A Retrospective

TL;DR; After migrating three production Python web apps from MongoEngine to the Raw+DC database pattern, I measured nearly 2x the requests per second, 18% less memory, and gained native async support. Raw+DC delivered real-world performance gains, not just synthetic benchmarks. About a month ago, I wrote about a new design pattern I’m seeing gain traction in the software space: Raw+DC: The…

Fire and Forget at Textual

If you read my Fire and Forget (or Never) about Python and asynchronous programming, you could think it’s a super odd edge case. But a reader/listener, Richard, pointed me at Will McGugan’s article The Heisenbug lurking in your async code . This is basically the same article, but in Will-style. Will does say “This behavior is well documented, as you can see from this…

Replacing Flask with Robyn wasn't worth it

TL;DR; I converted Python Bytes from Quart/Flask to the Rust-backed Robyn framework and benchmarked it with Locust . There was no meaningful speed or memory improvement - and Robyn actually used more memory. Framework maturity, ecosystem depth, and app server flexibility still matter more than raw benchmark numbers. Last week I played with the idea of replacing Quart (async Flask ) with Robyn for…

Use Chameleon templates in the Robyn web framework

TL;DR; Chameleon-robyn is a new Python package I created that brings Chameleon template support to the Robyn web framework . If you prefer Chameleon’s structured, HTML-first approach over Jinja and want to try Robyn’s Rust-powered performance, this package bridges the two. People who have known me for a while know that I’m very much not a fan of the Jinja templating language .…

Fire and forget (or never) with Python’s asyncio

TL;DR; Python’s asyncio.create_task() can silently garbage collect your fire-and-forget tasks starting in Python 3.12 - they may never run. The fix: store task references in a set and register a done_callback to clean them up. Do you use Python’s async/await in programming? Often you have some async task that needs to run, but you don’t care to monitor it, know when it’s…

Will AI Kill Open Source?

TL;DR; No - AI won’t kill open source, but it will reshape it. Small, single-purpose packages (micro open source) are likely to languish as AI agents write trivial utility code on the fly. But major frameworks, databases, and runtimes like Django, Postgres, and Python itself aren’t going anywhere - AI agents actually prefer reaching for established building blocks over reinventing…

What hyper-personal software looks like

Have you heard that the age of hyper-personal software is upon us? Typically what people mean is that agentic AI allows the creation of simple and small software built by individuals, often not super technical individuals, to solve a personal problem. As a result, we will see this explosion of software and the death of SaaS. Naysayers point to the lack of many new software projects being launched…

Raw+DC: The ORM pattern of 2026?

Recently I have started going Raw+DC on my databases . I think I love it. Let me explain. TL;DR; After 25+ years championing ORMs, I’ve switched to raw database queries paired with Python dataclasses. I’m calling it the Raw+DC pattern . The result: better AI coding assistance, fewer aging dependencies, comparable or better performance, and type safety where it counts. ORM/ODM Raw+DC…

Your Terminal Tabs Are Fragile. I Built Something Better.

TL;DR: I built Command Book, a native macOS app that gives your long-running terminal commands a permanent home. Free to download at commandbookapp.com . Terminal pain points I’ve been a terminal power user for over 20 years. And I’m done using terminal tabs as a process manager. Here’s why. It’s a familiar tale. You sit down to work in the morning and you have to get a…

It's not vibe coding: Agentic engineering

I’ve been bewildered by the wide range of experiences that software developers observe when working with AI. This has led many of us to outright reject AI for coding. There are reasons for this variance. Skeptics want to lightly dip their foot in the water to see what it’s about . This manifests as using the cheapest or free models and “just send it” styles of programming.…

Blocking AI crawlers might be a bad idea

TL;DR: You can’t stop people from using AI or put it back in the box. Blocking AI crawlers feels satisfying but just makes you invisible to users who rely on AI recommendations. This post covers the tradeoffs content creators face in an AI world and why embracing AI integrations beats hiding from them. Over at Talk Python To Me , I added a couple of deep AI integrations. You can read about…

Always activate the venv (a shell script)

TL;DR: Add this Zsh script to your .zshrc to automatically activate/deactivate venv or .venv as you navigate directories. It includes a whitelist feature for security. Using a virtual environment is a well-known and important best practice for working on Python projects that use third-party dependencies, i.e. pretty much every Python project out there. But it’s a hassle to make sure you…

Python Numbers Every Programmer Should Know

There are numbers every Python programmer should know . For example, how fast or slow is it to add an item to a list in Python? What about opening a file? Is that less than a millisecond? Is there something that makes that slower than you might have guessed? If you have a performance sensitive algorithm, which data structure should you use? How much memory does a floating point number use? What…

DevOps Python Supply Chain Security

TL;DR: Run pip-audit in an isolated Docker container before installing updated dependencies on your dev machine. Build a reusable pipauditdocker image and alias pip-audit-proj to test requirements.txt in isolation before they touch your local environment. In my last article, “ Python Supply Chain Security Made Easy ” I talked about how to automate pip-audit so you don’t…

Python Supply Chain Security Made Easy

TL;DR: Wire pip-audit into your CI and unit tests to automatically block known vulnerable dependencies. Add a delay with uv pip compile --exclude-newer "1 week" to avoid installing packages before security issues are discovered. See Part 2 for Docker-based protection. Maybe you’ve heard that hackers have been trying to take advantage of open source software to inject code into your machine,…

This Course Has Its Own Soundtrack

Here’s a first: My latest course, Agentic AI Programming for Python Devs , comes with a 5-track soundtrack ! Wondering why a soundtrack? Why in the world would you create a soundtrack for a course? This course has a few odd quiet, silent sections. Most of it is standard Michael talking style. But when Claude is working hard, sometimes I want you all to just see what it’s doing and I…

AI Usage TUI

TL;DR: Track your AI coding credits with AI Usage TUI . See if you’re on pace to run out before your renewal day. Install with uv tool install aiusage and run aiusage to start tracking. I just published a new open source tool: AI Usage TUI . The picture above tells most of the tale. But in this age of agentic AI coding, you’ll hear many complaints along the lines of: Anyone else…

Course: Agentic AI for Python Devs

I just published a brand new course over at Talk Python : Agentic AI Programming for Python Devs . This course teaches you how to collaborate with agentic AI tools , not just chatbots or autocomplete, but AI that can understand your entire project, execute commands, run tests, format code, and build complete features autonomously. You’ll learn to guide these tools like you would a talented…

Show me your ls

TL;DR: Replace your default ls with pls for icons, colors, human-readable sizes, and .gitignore-aware output. Just alias ls="pls --details size" and install a NerdFont. Getting comfortable in the terminal is one of those coming-of-age moments for developers and data scientists. Whenever I open the default terminal on macOS or Linux, I’m shocked at just how bad it is. There are many tools and…

Primed: Should You Hype Your AI Before You Start?

I’ve been having some amazing successes with agentic AI and coding lately. A run-down post on these would be interesting. You can find one write-up at Goodbye Wordpress, thanks AI . With this as the backdrop, let me ask you a question. Should you amp up your AI at the start of a project? We’ve heard the debates about whether you should be polite and thank your AI. I think yes but never…

Talk Python in Production book is out!

I’m thrilled to share that my first solo book is published: Talk Python in Production . Here’s the deal Much of the advice we get about running our apps and APIs on the internet is overly complex. Many people and organizations are selling you this complexity . The hyperscale clouds see their lock-in of your app to their 100+ services as a golden ticket. And there are plenty of…

Goodbye Wordpress, thanks AI

TL;DR: Used Cursor + Claude Sonnet 4 to migrate 164 Wordpress articles to Hugo in 2 hours. AI handled downloading, converting to markdown, relinking images, and building NGINX redirects. Finally deleted my old Wordpress site and stopped paying $48/yr. To all the naysayers who think AI coding is just a bunch of slop and we’re better off just avoiding it, I want to share a story of massive…

Roosevelt's Man in the Arena, But for Developers

If you enjoy quotes and you’re into software development, I think you’ll get a kick out of this. I’m a big fan of Theodore Roosevelt’s Man in the Arena speech / quote. What if he was talking about software development and the challenges and persistence required to succeed there? The OG: Theodore Roosevelt’s Man in the Arena: Original quote (very slightly modernized): It is not…

Sunsetting Search?

Have you noticed a change in your search engine use? I definitely have and it’s a strong downward trend. Last year I saw a stat that said the average person does fewer than 300 searches per month. I thought that was insanely low for my search usage and probably was very low for most developers and other tech people. I just checked for myself and in March 2025 across all of my devices…

Michael's Top Trends of 2024 for Python Web Devs

I wrote an in-depth article covering my top trends for 2024 based on the PSF Developer Survey data. Here are the top trends in a list, but you should definitely check out the full article for the pictures and the analysis. Top Trends for Python Web Devs Python usage with other languages drops as general adoption grows . 41% of Python developers have under 2 years of experience . Python learning…

Talk Python migrated to Quart web framework

Over at Talk Python, I just finished converting our existing web app from Pyramid to Quart and from synchronous to asynchronous web code. And I did a big write up in case it helps anyone on similar journeys: From the Talk Python blog : The code powering talkpython.fm is highly modern and leverages many new Python concepts. It makes extensive use of Pydantic with its entire data access layer…

Blue Skies ahead (follow me there)

I’ve found some Blue Skies! With a bunch of my favorite tech people moving over to Bluesky , it’s time to set up shop over there. So if you’re on (or want to join) bsky.app , consider giving me and the podcasts a follow: Michael on bsky.app -> @mkennedy.codes Talk Python on bsky.app -> @talkpython.fm Python Bytes on bsky.app -> @pythonbytes.fm And if you’re looking for some…

Introducing chameleon-flask package

TL;DR: I created chameleon-flask , a package that adds Chameleon template support to Flask. Use @chameleon_flask.template('page.pt') as a decorator and return a dict to render templates. Works with both sync and async views. I’m a big fan of the Chameleon templating language for Python web apps. For a long time it was the default HTML flavor for Pyramid. But I’m kicking off a new…

Talk Python has moved to Hetzner

From the Talk Python blog : After almost 10 years at Digital Ocean , we’ve moved our entire infrastructure to Hetzner ’s US-based data center in Virginia. This is a big change. We have over 20 different web apps, APIs, background daemons, and databases all working loosely together. Plus I have 10 years of experience running infrastructure in Digital Ocean’s cloud. Give the full article a read .…

Opposite of Cloud Native is?

TL;DR: The opposite of cloud-native isn’t “lift-and-shift” or building your own data center. It’s stack-native : building your app with just enough full-stack building blocks to run reliably with minimal complexity. We run 28 apps serving 9M requests/month on one $65/mo Hetzner server. Same setup in AWS? $1,226/mo. There seems to be a lot of contention lately about whether…

Search Talk Python from your address bar

TL;DR: Add Talk Python and Python Bytes as custom search engines in your browser. Use shortcuts like “tp” to search 9 years of episodes and transcripts directly from your address bar. Setup instructions at search.talkpython.fm/api/browser. I’ve put a ton of effort into Talk Python and Python Bytes to make our content discoverable and open. Our RSS feeds have all 9 years of…

We Must Replace uWSGI With Something Else

TL;DR: uWSGI is now in maintenance-only mode. Replace it with Granian (recommended), uvicorn, hypercorn, or gunicorn with uvicorn workers. All support ASGI for async Python web apps. If you’ve been using uWSGI as your Python web server, you’ll be interested in this prominent message at the top of the uWSGI project : “Note: The project is in maintenance mode (only bug fixes and…

Let's go easy on PyPI, OK?

[ Post updated Sept 30, 2024 based on lots of community conversations.] TL;DR: Stop reinstalling all Python packages on every Docker build. Copy and install requirements.txt before your source code, and pre-install core dependencies in an unchanging layer. Docker’s layer caching will reduce your PyPI calls by 100x. What do you think of when you visualize the Python Package Index and someone…

Passkeys are great, careful of the lock-in

TL;DR: Passkeys are great for security, but Apple/Google/Microsoft want to lock you in by syncing them only within their ecosystems. Use a third-party password manager like 1Password or Bitwarden to store passkeys instead and keep your freedom. People suck at passwords, just look at haveibeenpwned . Yet, they have been with us for a very long time and still today serve a very important purpose.…

Docker images using uv's python

TL;DR: Stop building Python from source in Docker (10+ minutes). Use uv venv --python 3.14 /venv to install Python in seconds. Pre-install common packages in a base image and use uv pip install for near-instant builds. Why uv replaces building Python from source A lot has been written [ 1 , 2 , 3 ] about uv’s new features allowing it to not just work within Python but to manage Python itself…

Keynote: The State of Python in 2024

This is a short post. I’m excited to announce that my keynote at PyCon Philippines is now available for everyone on YouTube . Have a watch and let me know what you think in the comment section on the video. Cheers, Michael.

Use Custom Search Engines Way More

TL;DR: Add custom search engines to your browser with short prefixes. Type “gh react” to search GitHub, “pypi requests” for PyPI, “u mountains” for Unsplash. Skip the middleman and search sites directly from your address bar. What’s your favorite search engine? Do you live in the privacy-side of the web and choose DuckDuckGo, Kagi, or Brave Search? Are you…

Unsolicited Advice for Mozilla and Firefox

TL;DR: Firefox is dying from lack of focus. My 4 paths forward: (1) Build a privacy-focused office/cloud suite to compete with Google, (2) Go all-in on privacy like Vivaldi/Brave, (3) Become a VC for like-minded startups, (4) Spoof Chrome’s user agent to stop “Firefox not supported” warnings. I recently read an article entitled “ What’s next for Mozilla ?” over…

AI Features a Waste of Time?

I was letting my mind wander the other day and this thought hit me hard: How many cumulative programmer-hours have been utterly wasted on adding very mediocre AI features to every app imaginable which rarely actually helps you? Speaking from a pure product perspective, I’m thinking of putting off that work-a-day feature like “Autocomplete should work for name or email address, not just email” and…

Hide Those Terminal Secrets!

TL;DR: Use Warp terminal’s secret redaction feature to automatically hide IP addresses, emails, API keys, and other sensitive data when screen sharing or recording. Enable it in settings and add custom regexes for your specific secrets. Do you do presentations and want/need to show your terminal? Maybe it’s a conference talk and it’d be awesome to pull an example from a real log…

Don't Sweat the Ad Blocker Drama

TL;DR: Skip browser-based ad blockers entirely. Use NextDNS ($1.65/mo) for network-level blocking that works on all devices, everywhere. Chrome’s Manifest V3 can’t touch it. You may have read with some dread (as I did) about Google’s various initiatives to block ad-blockers in Chrome by effectively breaking the Chrome Extension features via something called Manifest V3. What are…

You Can Ignore This Post

GitHub has a whole repo full of ignores you can make use of. You might know that uncertainty of creating a new GitHub repository and are confronted with the dropdown “ Add .gitignore ”. Do you choose Python? You are writing a Flask app, right? Wait, should you choose VisualStudio if you’re using VS Code? Maybe Node is the right choice if you are using npm for some front-end…

Rebuilding Mobile Apps at Talk Python

TL;DR: Talk Python’s mobile apps have been rebuilt from scratch in Flutter, replacing the end-of-life Xamarin version. Download the new apps for iOS and Android to watch courses offline with a much better UI. We just completed a wonderful journey over at Talk Python Training . We offer over 240 hours of Python course videos at Talk Python. Of course, we want our users to have the very best…

Dev on the Road

TL;DR: Leave your laptop at home. For travel emergencies, use: (1) Prompt app for SSH access, (2) GitHub.dev for editing code in the browser, (3) GitPod for a full dev environment. All work on an iPad. The Problem I am going on a non-work trip such as a weekend getaway to the coast or a week of skiing. I won’t be doing much or any work unless there is a critical infrastructure error . If…

Welcome back RSS

TL;DR: RSS is making a comeback as people tire of algorithmic feeds and walled gardens. It powers podcasting (Talk Python serves 0.2 TB of RSS XML monthly), and great readers like Reeder make it easy. If you’re a developer, add RSS to your projects. When was the last time you thought about RSS ? You know, that wacky XML format for subscribing to blogs? There are some interesting tech and…

Paying for search in 2022, am I crazy?

TL;DR: After 6+ months using Kagi, I’m still paying $10/month for search. The results match Google, there are no ads or trackers, and you can permanently block SEO-spam sites. Worth it if you can afford it and value privacy. I have some core beliefs about the technology world as a software developer and netizen. Open software and tools should be preferred Surveillance capitalism is net-net…

Sometimes, You Should Build It Yourself

TL;DR: Not Invented Here syndrome gets a bad rap, but sometimes building it yourself pays off. It did for Talk Python: better UX, custom integrations, real coding experience, and it’s fun. Just be selective about what you build. Developers are often itching to try out the latest shiny tech on problems they’ve been asked to solve, even when there are perfectly good existing solutions…

Properly Factor Your Jinja HTML Code with Jinja Partials

TL;DR: Use the jinja-partials package to add function-like reusability to your Jinja templates. It lets you call named template fragments with parameters, avoiding the 600-line template problem. If you work with Python code, then you’ve surely seen some bad code. Martin Fowler popularized the idea of code smells . “Code smells are certain structures in the code that indicate violation…