Skip to main content

The Developer's Toolbelt For Accelerating Mean-Time-To-Party on AWS

Project description

Kegstand logo

The Developer's Toolbelt For Accelerating Mean Time To Party on AWS

Created by Jens Roland and fueled by a non-zero amount of alcohol

Watch a 3-minute demo


🥂💃🕺 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.

It provides:

  • A CLI tool for creating and deploying your services.
  • A decorator based API abstracting away the boilerplate of Lambda, API Gateway, Cognito, and more.
  • The full power of CDK to define and deploy arbitrary AWS resources with your services.

"Experience a streamlined cloud development process, enhanced productivity, and hit that "party" button sooner with Kegstand!" > — GPT-4, official spokesbot for the Kegstand team

Learn more on the Kegstand website.

Prerequisites

Quick start

To create a service with Kegstand, you'll need a Python project with a few dependencies and a folder structure following the Kegstand convention.

You can create this in a few seconds, either with the Kegstand CLI or using Copier.

# Using the Kegstand CLI
> uvx install kegstandcli  # Or `pipx install kegstandcli`
> keg new my-service

# Using Copier
> copier copy -d project_name=my-service gh:JensRoland/kegstand-project-template .

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

📁 my-service
├── 📄 .gitignore                    # Standard .gitignore file
├── 📄 pyproject.toml                # Project configuration
└── 📁 src
    └── 📁 api
        └── 📁 public
            └── 📄 hello.py          # Logic for /hello/

Kegstand projects are minimal by design, so a fresh project folder contains just those 3 files. Well, apart from a few empty __init__.py gatecrashers, but we can safely ignore those.

Install the dependencies for the new project (uv will do this for you during uv run so it's not strictly necessary):

> cd my-service
> uv sync

Finally, to build and deploy the service to AWS:

> uv run keg deploy

Note: If you installed the Kegstand CLI globally with uvx or pipx, you could also run keg deploy directly, but it is recommended to use uv run to ensure that you are using the correct CLI version for the specific project.

You should now be able to access the API endpoint at https://<api-id>.execute-api.<region>.amazonaws.com/prod/hello.

Documentation

For further examples and more advanced usage, see the official documentation.

Roadmap

Here are some notable changes, fixes and features that are planned for development:

0.4.0

  • More content on kegstand.dev
  • Custom domain names
  • Support multiple repos using the same domain (and API Gateway)
  • Simplify the folder structure from src/api/resources/<resource-name>/<method>.py to src/api/<resource-name>.py
  • Add support for uv for package management in projects
  • Write unit tests

Pre-1.0.0

  • Increase test coverage to >70% and configure CI to enforce this for all PRs
  • Specify event triggers for Lambda functions: S3, SNS, SQS, DynamoDB, Cloudwatch CRON scheduled events, etc.
  • Pagination helper
  • Record a screencast for the README
  • Autogenerated docs using MkDocs or similar
  • GitHub Actions workflow for pushing docs to the website

1.0.0

  • Intuitive and mostly automated API Versioning
  • Simple way to define/override core API/Lambda properties such as CPU/MEM, Python runtime version, warm pool (!), and concurrency
  • Deploy Lambda-only microservices with no API Gateway
  • Folder of example projects for common use cases: CRUD, auth, File management on S3.

Future

  • Configurable log level
  • Add AWS tags in the Kegstand config and they will be applied to the generated resources
  • Easily add AWS Lambda Layers
  • Add support for APIs using FastAPI with Mangum instead of the default Kegstand API framework, and just provide deployment helpers for the API Gateway and Lambda
  • Improved output from deploy command; friendly post-deploy instructions for testing your API
  • Version bumper with bump2version
  • Include more goodies from Lambda Powertools - tracing, metrics, etc.
  • Add support for APIs using pure Lambda Powertools instead of the default Kegstand API framework, and just provide deployment helpers for the API Gateway and Lambda
  • Unit testing helpers (wrap moto and make it all a little more DRY and intuitive)
  • Secure endpoints which require re-authentication (and/or MFA) so a refreshed token isn't enough (to, say, delete your account or change your credit card info)
  • Live Lambda development a la SST
  • Build and deploy gRPC endpoints (or similar alternative)
  • Option to teardown before deploying: keg deploy --force-redeploy
  • Use env vars to populate values in kegstand.toml
  • Add kegstand.toml schema to the JSON Schema Store and add the schema URL at the top like #:schema https://json.schemastore.org/kegstand.json
  • Merge Kegstand and Beth into one tool?
  • CDK Pipelines
  • Support HTTP method-specific files (e.g. get.py, post.py, etc.)
  • Upgrade Copier once the template-deleting bugfix is released

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kegstandcli-0.3.10.tar.gz (88.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kegstandcli-0.3.10-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

Details for the file kegstandcli-0.3.10.tar.gz.

File metadata

  • Download URL: kegstandcli-0.3.10.tar.gz
  • Upload date:
  • Size: 88.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.9

File hashes

Hashes for kegstandcli-0.3.10.tar.gz
Algorithm Hash digest
SHA256 f96f06919d74f5f7497714b371e7024d9f0fe60407ffcb37a55a2b6dd392a527
MD5 2e0f3973a76ea2a9489094c005dcd6ce
BLAKE2b-256 803c3a13776bf479b264b72f92fde88af1dfde310fa31ce9760d92c7e1304680

See more details on using hashes here.

File details

Details for the file kegstandcli-0.3.10-py3-none-any.whl.

File metadata

File hashes

Hashes for kegstandcli-0.3.10-py3-none-any.whl
Algorithm Hash digest
SHA256 9cff694a6815d8765b058e4cd1d435192a65d4b1bc0c262eb17da1f8fd3f2992
MD5 247707bea4af42136bd05a38d638eb9c
BLAKE2b-256 d647480ca86d4dd3a921dc6d9a0ae06a373ec3ad56f3228303616cd08be95861

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page