Skip to main content

A lightweight ASGI framework

Project description

Teke

Teke is a lightweight ASGI framework that you can use to create fast async REST APIs with Python.

Requirements

Python 3.10+

Installation

$ pip install teke

You'll also want to install an ASGI server, such as uvicorn, daphne, or hypercorn.

$ pip install uvicorn

Example

example.py:

from teke import JsonResponse, Router, create_app

router = Router()

@router.route("/hello/<name>")
async def hello(connection, name):
    return JsonResponse({"hello": name})

app = create_app(routers=[router])

Then run the application using Uvicorn:

$ uvicorn example:app

Run uvicorn with --reload to enable auto-reloading on code changes.

For a more complete example, see exampleshere.

Coming soon:

  • WebSocket support
  • Lifecycle hooks
  • CORS middleware

Dependencies

teke depends on the following python packages:

  • anyio
  • uvloop
  • Werkzeug

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

teke-0.0.1.tar.gz (6.5 kB view hashes)

Uploaded Source

Built Distribution

teke-0.0.1-py3-none-any.whl (6.8 kB view hashes)

Uploaded Python 3

Supported by

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