chalice is a free, open source build & deployment project written in Python and released under Apache-2.0. It has 11,059 GitHub stars, 1,011 forks and 495 open issues, and was last pushed 6 days ago. On this registry it ranks #14 of 59 tracked projects in Build & Deployment, with 5 head-to-head comparisons available. It gained 1 stars over the last 3 tracked days.

What is chalice?

Chalice is an Apache-2.0 Python microframework from AWS for writing serverless applications that run on AWS Lambda, aimed at Python developers who want to declare API Gateway routes, scheduled tasks, and event handlers with decorators and ship them with a single command line tool.

What it is

Chalice is a framework for writing serverless apps in Python, distributed on PyPI as the chalice package and documented at aws.github.io/chalice. It provides three things: a command line tool for creating, deploying, and managing an application, a decorator based API for integrating with Amazon API Gateway, Amazon S3, Amazon SNS, Amazon SQS, and other AWS services, and automatic IAM policy generation. The library lives squarely in the AWS ecosystem, alongside boto3, the AWS SDK for Python, and the AWS CLI.

The concrete problem it solves is the hand-assembly of the AWS resources that sit between a Python function and its trigger. Without a framework, a developer writing a Lambda-backed HTTP endpoint has to create the function, create an API Gateway resource and method, wire an integration, grant lambda:InvokeFunction permission, and write the IAM policy that lets the function reach anything else it needs. Chalice replaces that manual wiring with declarations in Python. A decorated function is the whole specification: the framework reads the decorators, generates the required CloudFormation resources and IAM policies, and applies them. The python27 and python3 topics reflect a project that has tracked Python runtimes across a long life, and the README states support for every Python version AWS Lambda supports, from Python 3.10 through Python 3.14.

Key capabilities

  • Project scaffolding with chalice new-project helloworld, which generates the application directory and starter files.
  • One-command deployment through chalice deploy, which creates the Lambda function and related AWS resources and prints the resulting endpoint URL.
  • REST API definitions using @app.route("/") on a function, with the response serialized as JSON.
  • Periodic task scheduling using @app.schedule(Rate(5, unit=Rate.MINUTES)).
  • S3 event handling using @app.on_s3_event(bucket="mybucket"), receiving event.bucket and event.key.
  • SQS message handling using @app.on_sqs_message(queue="my-queue-name"), iterating record.body over a batch.
  • Automatic IAM policy generation, so permissions are derived from the decorators rather than written by hand.

Who uses it and how

  • Small teams and individual developers building HTTP APIs in Python, where the entire backend fits in one Chalice application and deploys from a developer machine.
  • Event-driven pipelines that react to object uploads, using @app.on_s3_event to run processing code whenever an object lands in a named bucket.
  • Background job consumers, where @app.on_sqs_message drains a named queue and processes each message body in the batch.
  • Recurring maintenance work, where @app.schedule with a Rate runs a function on a fixed interval without an external cron host.
  • Developers already configured for boto3 or the AWS CLI, whose existing credentials in ~/.aws/config are reused directly and need no separate setup.

Getting started

Install from PyPI with python3 -m pip install chalice inside a virtual environment, then run chalice new-project helloworld to scaffold the application and chalice deploy to ship it. AWS credentials must be configured before deployment, either through the ~/.aws/config file shown in the README or through any other method supported by boto3.

How it compares

No paid products and no comparable frameworks are named in the material available for this entry, so Chalice currently stands alone in this registry on the serverless Python framework axis. The comparison that matters here is between Chalice and writing the same AWS resources by hand: the framework trades direct control over every CloudFormation detail for generated configuration and a decorator surface. Its licence, Apache-2.0, places no cost or restriction on that trade.

When to use it — and when not to

Adoption means running an AWS account, holding deploy credentials, and accepting that the generated IAM policies and CloudFormation resources are managed by the tool rather than authored directly, which is a poor fit for anyone who needs precise control over that infrastructure or who is not deploying to AWS at all. Chalice is also not the right choice for a team that cannot absorb the framework's abstraction over API Gateway and Lambda configuration, or that needs a runtime AWS Lambda does not offer. The honest weaknesses visible in the facts are a large open issue count at 495 and a README excerpt that stops mid-sentence and defers substantial detail to the external documentation site, so prospective users should read the linked docs before committing.

project readme (upstream, from github) — read inline

=========== AWS Chalice

.. image:: https://img.shields.io/pypi/v/chalice.svg?style=flat :target: https://pypi.python.org/pypi/chalice/ :alt: Package Version

.. image:: https://img.shields.io/pypi/pyversions/chalice.svg?style=flat :target: https://pypi.python.org/pypi/chalice/ :alt: Python Versions

.. image:: https://readthedocs.org/projects/chalice/badge/?version=latest :target: https://aws.github.io/chalice/?badge=latest :alt: Documentation Status

.. image:: https://img.shields.io/pypi/l/chalice.svg?style=flat :target: https://github.com/aws/chalice/blob/master/LICENSE :alt: License

.. image:: https://aws.github.io/chalice/_static/img/chalice-logo-whitespace.png :target: https://aws.github.io/chalice/ :alt: Chalice Logo

Chalice is a framework for writing serverless apps in Python. It allows you to quickly create and deploy applications that use AWS Lambda. It provides:

  • A command line tool for creating, deploying, and managing your app
  • A decorator based API for integrating with Amazon API Gateway, Amazon S3, Amazon SNS, Amazon SQS, and other AWS services.
  • Automatic IAM policy generation

You can create Rest APIs:

.. code-block:: python

from chalice import Chalice

app = Chalice(app_name="helloworld")

@app.route("/")
def index():
    return {"hello": "world"}

Tasks that run on a periodic basis:

.. code-block:: python

from chalice import Chalice, Rate

app = Chalice(app_name="helloworld")

# Automatically runs every 5 minutes
@app.schedule(Rate(5, unit=Rate.MINUTES))
def periodic_task(event):
    return {"hello": "world"}

You can connect a lambda function to an S3 event:

.. code-block:: python

from chalice import Chalice

app = Chalice(app_name="helloworld")

# Whenever an object is uploaded to "mybucket"
# this lambda function will be invoked.

@app.on_s3_event(bucket="mybucket")
def handler(event):
    print(
        f"Object uploaded for bucket: {event.bucket}, key: {event.key}"
    )

As well as an SQS queue:

.. code-block:: python

from chalice import Chalice

app = Chalice(app_name="helloworld")

# Invoke this lambda function whenever a message
# is sent to the ``my-queue-name`` SQS queue.

@app.on_sqs_message(queue="my-queue-name")
def handler(event):
    for record in event:
        print(f"Message body: {record.body}")

And several other AWS resources.

Once you've written your code, you just run chalice deploy and Chalice takes care of deploying your app.

::

$ chalice deploy
...
https://endpoint/api

$ curl https://endpoint/api
{"hello": "world"}

Up and running in less than 30 seconds. Give this project a try and share your feedback with us here on GitHub.

The documentation is available here __.

Quickstart

.. quick-start-begin

In this tutorial, you'll use the chalice command line utility to create and deploy a basic REST API. This quickstart uses Python 3.10, but AWS Chalice supports all versions of Python supported by AWS Lambda, which includes Python 3.10 through Python 3.14.

To install Chalice, we'll first create and activate a virtual environment in python3.10::

$ python3 --version
Python 3.10.20
$ python3 -m venv .venv
$ . .venv/bin/activate

Next we'll install Chalice using pip::

$ python3 -m pip install chalice

You can verify you have chalice installed by running::

$ chalice --help
Usage: chalice [OPTIONS] COMMAND [ARGS]...
...

Credentials

Before you can deploy an application, be sure you have credentials configured. If you have previously configured your machine to run boto3 (the AWS SDK for Python) or the AWS CLI then you can skip this section.

If this is your first time configuring credentials for AWS you can follow these steps to quickly get started::

$ mkdir ~/.aws
$ cat >> ~/.aws/config
[default]
aws_access_key_id=YOUR_ACCESS_KEY_HERE
aws_secret_access_key=YOUR_SECRET_ACCESS_KEY
region=YOUR_REGION (such as us-west-2, us-west-1, etc)

If you want more information on all the supported methods for configuring credentials, see the boto3 docs __.

Creating Your Project

The next thing we'll do is use the chalice command to create a new project::

$ chalice new-project helloworld

This will create a helloworld directory. Cd into this directory. You'll see several files have been created for you::

$ cd helloworld
$ ls -la
drwxr-xr-x   .chalice
-rw-r--r--   app.py
-rw-r--r--   requirements.txt

You can ignore the .chalice directory for now, the two main files we'll focus on is app.py and requirements.txt.

Let's take a look at the app.py file:

.. code-block:: python

from chalice import Chalice

app = Chalice(app_name='helloworld')


@app.route('/')
def index():
    return {'hello': 'world'}

The new-project command created a sample app that defines a single view, /, that when called will return the JSON body {"hello": "world"}.

Deploying

Let's deploy this app. Make sure you're in the helloworld directory and run chalice deploy::

$ chalice deploy
Creating deployment package.
Creating IAM role: helloworld-dev
Creating lambda function: helloworld-dev
Creating Rest API
Resources deployed:
  - Lambda ARN: arn:aws:lambda:us-west-2:123456789012:function:helloworld-dev
  - Rest API URL: https://abcd.execute-api.us-west-2.amazonaws.com/api/

You now have an API up and running using API Gateway and Lambda::

$ curl https://abcd.execute-api.us-west-2.amazonaws.com/api/
{"hello": "world"}

Try making a change to the returned dictionary from the index() function. You can then redeploy your changes by running chalice deploy.

.. quick-start-end

Next Steps

You've now created your first app using chalice. You can make modifications to your app.py file and rerun chalice deploy to redeploy your changes.

At this point, there are several next steps you can take.

  • Tutorials __
    • Choose from among several guided tutorials that will give you step-by-step examples of various features of Chalice.
  • Topics __ - Deep dive into documentation on specific areas of Chalice. This contains more detailed documentation than the tutorials.
  • API Reference __ - Low level reference documentation on all the classes and methods that are part of the public API of Chalice.

If you're done experimenting with Chalice and you'd like to cleanup, you can use the chalice delete command, and Chalice will delete all the resources it created when running the chalice deploy command.

::

$ chalice delete
Deleting Rest API: abcd4kwyl4
Deleting function arn:aws:lambda:region:123456789012:function:helloworld-dev
Deleting IAM Role helloworld-dev

Feedback

We'd also love to hear from you. Please create any GitHub issues for additional features you'd like to see over at https://github.com/aws/chalice/issues.

Frequently asked questions

Is chalice free to use?

chalice is open source under the Apache-2.0 licence. There is no licence fee and no seat count — you can self-host it or, where the project offers one, pay a vendor for a managed version instead.

What does chalice do?

Python Serverless Microframework for AWS

What is chalice written in?

chalice is primarily written in Python. Its source is publicly available at https://github.com/aws/chalice, and it has 11,059 GitHub stars.