https://github.com/kodemore/chocs
Modern HTTP framework for AWS Serverless and WSGI compatible servers.
https://github.com/kodemore/chocs
aws aws-lambda framework python rest
Last synced: 8 months ago
JSON representation
Modern HTTP framework for AWS Serverless and WSGI compatible servers.
- Host: GitHub
- URL: https://github.com/kodemore/chocs
- Owner: kodemore
- License: mit
- Created: 2019-12-18T17:18:42.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2024-05-26T15:14:16.000Z (almost 2 years ago)
- Last Synced: 2025-06-28T07:06:36.391Z (9 months ago)
- Topics: aws, aws-lambda, framework, python, rest
- Language: Python
- Homepage:
- Size: 830 KB
- Stars: 16
- Watchers: 3
- Forks: 3
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

# Chocs
[](https://pypi.org/project/chocs/)   [](https://codecov.io/gh/kodemore/chocs) [](https://codeclimate.com/github/kodemore/chocs/maintainability)
Chocs is a modern HTTP framework for building AWS HTTP API/REST API and WSGI compatible applications.
Chocs aims to be small, expressive, and robust.
It provides an elegant API for writing fault-proof, extensible microservices.
## Features
- AWS Serverless integration
- Elegant and easy API
- No additional bloat like built-in template engines, session handlers, etc.
- Compatible with all WSGI servers
- Loosely coupled components which can be used separately
- Multipart body parsing
- Graceful error handling
- HTTP middleware support
- Fast routing
- Middleware packages to simplify daily tasks
## Installation
```
pip install chocs
```
or with poetry
```
poetry add chocs
```
## Quick start
```python
import chocs
http = chocs.Application()
@http.get("/hello/{name}")
def hello(request: chocs.HttpRequest) -> chocs.HttpResponse:
return chocs.HttpResponse(f"Hello {request.path_parameters.get('name')}!")
chocs.serve(http)
```
> Keep in mind that the `chocs.serve()` function is using the `bjoern` package, so make sure you included it in your project
> dependencies before using it. You are able to use any WSGI compatible server.
## Available middlewares
### OpenAPI Integration middleware
Allows integrating OpenAPI documentation into your codebase, providing automating request validation based
on your OpenAPI spec. More details are available in the [chocs-openapi repository](https://github.com/kodemore/chocs-openapi).
### ParsedBody middleware
Parsed body middleware helps to convert json/yaml request payloads into dataclass, this not only makes your
daily tasks easier but increases readability of your code and contract. More details are available in the [chocs-parsed-body repository](https://github.com/kodemore/chocs-parsed-body).
# Documentation
For usage and detailed documentation please visit our [wiki page](https://github.com/kodemore/chocs/wiki)