Skip to main content

Framework to develop multi cloud APIs.

Project description

About

This package provides a framework to develop portable APIs. Supported platforms: Azure Functions, AWS Lambda, GPC, Flask.

Install

pip install chestnut

How to use

Write functions to handle your API operations using the package chestnut.http request/response classes. The decorator @middleware will convert requests/responses from/to the current platform, which is defined in the environment variable CHESTNUT_MIDDLEWARE. It supports both functions and coroutines.

from chestnut.http import Request, Response
from chestnut import middleware


@middleware
def handler(req: Request) -> Response:
	message = "Hello {} !".format(
		req.query_params.get("name", "anonymous")
	)
	return Response(status=200, body=message)

Unit test

pip install -r requirements.txt -r test-requirements.txt
python -m pytest tests/ --cov=chestnut

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

chestnut-1.1.1.tar.gz (5.7 kB view details)

Uploaded Source

Built Distribution

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

chestnut-1.1.1-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file chestnut-1.1.1.tar.gz.

File metadata

  • Download URL: chestnut-1.1.1.tar.gz
  • Upload date:
  • Size: 5.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.12

File hashes

Hashes for chestnut-1.1.1.tar.gz
Algorithm Hash digest
SHA256 6dc01cfc53acb02eefc2ecc0e8a25dbb4c5ac2cd3fdb65ed07251dfcefa89adb
MD5 dcdcd95450e53c3ff28aa95928d091f2
BLAKE2b-256 2ae4184ac5a436c12dc285072bf528b5b2c52479d050c9c61e07bdba5d276aca

See more details on using hashes here.

File details

Details for the file chestnut-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: chestnut-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.12

File hashes

Hashes for chestnut-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 88aec54dccbbdc61528005c2cfaf41d97af069d9ea2c310ea248fffe114c3802
MD5 6031558bec49f1c7cc22d9bea36a8a8e
BLAKE2b-256 6b3d738e88cba1eb2049b8198c222225460ad7a6b294be1b278e316f5135e34a

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