Avatar

Why I Wrote MicroPie

2025-11-29T04:33:43Z · by Harrison Erd

Yes, already another post. I just built this blog, so obviously I’m going to use it like a kid who got a new toy and is now forcing everyone in the room to watch it light up. It’s not “content,” it’s a coping mechanism.

And no, probably no one will read this. But on the off chance some poor soul clicked a broken link and ended up here, let’s talk about MicroPie.

So why did I write it?

Because I liked circuits.web and wanted something even dumber. That’s it. That’s the spark of inspiration: “Hey, what if this were even smaller, weirder, and more inconvenient for normal people?”

Originally it was WSGI. Then I remembered it’s 2025 and I hate myself, so I ported it to ASGI in about a week. Then I added just enough to make it usable without it ever being “good.” It’s basically a glorified dict with routing.

But it works. It’s mine. It doesn’t try to be Flask or FastAPI. It doesn’t come with decorators that look like spaceship controls. It doesn’t try to predict your feelings. It just responds to HTTP requests and looks cute doing it.

MicroPie isn’t trying to win a framework war. It’s a napkin sketch.

How I Use It (and Why You Might)

Despite its humble cardboard-box energy, MicroPie can actually do things. Like... respond to HTTP requests. And talk to WebSockets. And return JSON for your API. And render templates if you’re feeling fancy.

Here’s what using MicroPie usually looks like for me:

Minimal Example


from micropie import App

class MyApp(App):
    async def index(self):
        return "Hello from MicroPie"

app = MyApp()

Run it with:

uvicorn app:app

And bam — you've got yourself an ASGI server that's not trying to extract your soul through dependency injection.

Why I Keep Using It

  • Automatic routing: Just name your method greet and /greet works. Name it _secret, and it's not exposed. Magic? No. Just basic literacy.
  • Async-first: Built for ASGI, runs happily on Uvicorn, and actually embraces async/await without crying about it.
  • Jinja2 support: Want templates? Install jinja2 and go nuts. Or don’t. It won’t yell at you.
  • Built-in WebSocket support: Just define a method like ws_chat(self, ws) and MicroPie figures it out. It's like real-time magic for people who refuse to read manuals.
  • Middleware without migraines: Drop in HttpMiddleware classes to do things like logging, auth, or just printing “hello” for every request because you’re lonely.
  • No frameworks pretending to be operating systems: MicroPie doesn’t want to control your life. It wants to quietly serve your weird little side project and not ask questions.

One More Example, For Fun


class MyApp(App):
    async def greet(self, name="stranger"):
        return f"Hi, {name}!"

Now /greet/Alice returns "Hi, Alice!" and /greet?name=Bob returns "Hi, Bob!". And if you break it, it’s your fault, not the framework’s.

If you want form handling, sessions, streaming, or lifespan events — it’s all there. Just check the README. Or don’t. I’m not your boss.

More examples: github.com/patx/micropie/tree/main/examples

Can It Scale?

Weirdly, yes.

Despite being a glorified router wrapped in async sugar, MicroPie can absolutely scale to handle serious traffic — thanks entirely to ASGI’s event loop wizardry and not because I did something smart.

Throw it behind Uvicorn workers with a proper process manager, use something like Redis or PostgreSQL for your backend, maybe slap a load balancer in front, and congrats — your little scrappy ASGI app is now quietly handling traffic like it wasn’t written by someone in pajamas at 2 AM.

You don’t need a 300-file Django monolith or FastAPI’s Pydantic-led bureaucracy to scale. You need a fast event loop, a predictable request lifecycle, and a brain that remembers to set timeouts.

MicroPie gives you that. Without magic. Without ceremony. Just you, your handlers, and the terrifying responsibility of making decisions.

So yes — it can scale. Not because it's bloated with features, but because it isn't.

Use it if you want to. Or just keep using whatever makes you feel alive. This blog isn’t a sermon. It’s a soapbox I built out of spare parts.

← Back to posts