A Development Toolbelt For Speeding Up Mean‑Time‑To‑Party In The Cloud

Welcome to the Party!

Kegstand is a free and open-source framework for creating Python APIs and services. It allows you to rapidly build and deploy services on AWS. We all have better things to do than print(json.dumps(event)) all day long, and Kegstand is here to help you get to the party — and into Prod — a lot faster.

Quick start

Install the Kegstand CLI package and create a new project with:

> pipx install kegstandcli
> keg new my-service

This will create a new project folder called my-service containing:

📁 my-service
├─ 📄 .gitignore
├─ 📄 pyproject.toml
└─ 📁 src
   └─ 📁 api
      └─ 📁 public
         └─ 📄 hello.py

Simply implement your API endpoint logic in the hello.py file using API decorators:

import kegstand api = kegstand.ApiResource("/hello") @api.get("/:name") def greet(params): return { "message": f"Hello, {params.get('name')}!" }

And deploy it to AWS with a single command:

> keg deploy

That's it! Your new API is now live* in the cloud 🎉

No need for Terraform HCL or Serverless YAML, no need to depend on twelve thousand node_modules, and no boilerplate clutter to get in the way.

The source code is available in the Kegstand repo on GitHub.

* Requires an AWS account and the AWS CLI and CDK to be installed and configured.

Beware! Alpha software ahead!

Kegstand is still very much a pre-1.0 project, so there's plenty of things missing:

"- But you'd have to be drunk to use this!"

Correct. -Cheers! 🍻

Kegstand vs. Serverless Framework

Launched in 2015 under the name JAWS, the Serverless Framework is one of the first frameworks of its kind and remains a popular choice for building serverless applications, boasting a ton of features and a large community. At its core, Serverless provides a simpler YAML-based syntax on top of Cloudformation and a number of plugins for various services.

However, its long history is also one of its biggest weaknesses, as the subsequent introduction of CDK, SAM, and Lambda Power Tools has made many of its key features largely redundant.

Furthermore, the YAML-based declarative syntax and the lack of a Pythonic API can make it less than ideal to work with for Python developers, who may find a more natural fit with Kegstand.

  Kegstand Serverless
Community support
 
GitHub
46k stars
Pythonic API
Yes
Active development
Yes1 Yes1
Local Lambda Development
for Python
4
IaC integration
CDK Cloudformation, SAM2
Python versions
 
Yes
3.10-3.13
 
Yes3
3.7-3.11
Escape hatches
Support for complex infra
 
Yes
Full CDK
 

Limited / experimental
  1. Actively maintained as of December 2024
  2. Serverless' SAM support is experimental
  3. Serverless' Python support feels a bit like an afterthought
  4. The serverless dev command only supports Node.js functions

Kegstand vs. Serverless Stack (SST)

SST broke onto the scene in 2017 as an alternative to Serverless Framework, optimized for TypeScript and originally built on top of CDK. The standout feature came in 2021 with its Live Lambda Development mode, which allowed you to develop a Lambda function locally and see the changes reflected in real-time in the cloud. This was a game-changer at a time when Lambda development tended to be a flaky affair involving extensive mocking with tools like LocalStack, or a tedious process of repeatedly deploying changes to AWS and waiting for the changes to propagate.

SST is unquestionably a great choice for TypeScript developers, but its Python support is still a second-class citizen and lacks the maturity and polish of its TypeScript counterpart. For Python developers looking for more seamless development experience, Kegstand offers a more tailored, though less mature, solution.

  Kegstand SST
Community support
 
GitHub
22k stars
Pythonic API
Yes
Active development
Yes1 Yes1
Local Lambda Development
for Python
Yes2
IaC integration
CDK Pulumi, Terraform3
Python versions
 
Yes
3.10-3.13
4
Escape hatches
Support for complex infra
 
Yes
Full CDK
 
Yes
Pulumi providers
  1. Actively maintained as of December 2024
  2. The sst dev command is quite magical, and it should work with Python once v3 support for Python lands
  3. SST v2 was built on CDK but they changed this in v3, released in 2024
  4. SST v3 only supports Node.js runtimes as of December 2024. Go support is in beta and Python 3.9-3.12 should be coming very soon

Kegstand vs. AWS Chalice

Kegstand and Chalice have very similar design goals, and indeed many of the design choices in Kegstand were inspired by Chalice. However, as Chalice development has all but stalled since 2020, Kegstand aims to provide a more modern and actively developed alternative.

  Kegstand Chalice
Community support
 
GitHub
10k stars
Pythonic API
Yes Yes
Active development
Yes1 1
IaC integration
CDK CDK or SAM
Python versions
 
Yes
3.10-3.13
 
Yes
3.7-3.12
Escape hatches
Support for complex infra
 
Yes
Full CDK
  1. Actively maintained as of December 2024

Also, a keg holds a lot more beer than a chalice. Trust us, we have conducted rigorous comparative analysis. 🍻

Kegstand vs. AWS SAM

Coming soon! (9.4k stars)