Skip to main content

simple web framework with features

Project description

kumquat

Simple asynchronous web framework, based on uvicorn.

Installation

Stable:

pip install kumquat

Unstable:

pip install https://github.com/kesha1225/Kumquat/archive/master.zip --upgrade

Usage

You can see more examples here.

from kumquat.application import Kumquat
from kumquat.response import TextResponse, JsonResponse, HTMLResponse
from kumquat.request import Request
from kumquat.response import SimpleResponse, TemplateResponse
import logging

logging.basicConfig(level="INFO")

app = Kumquat()
app.app_name = "KumquatApp"


@app.index()
async def index(request: Request, response: SimpleResponse):
    response.status_code = 418
    response.set_headers({"shue": "ppsh"})
    return HTMLResponse("<h1>hello</h1>")


@app.get("/<name>/<age>")
async def some_json_route(request: Request, response: SimpleResponse):
    name = request.path_dict["name"]
    age = request.path_dict["age"]
    return {"user": {"name": name, "age": age}}


app.run() # you can use ngrok - app.ngrok_run()

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

kumquat-0.0.2.tar.gz (5.1 kB view details)

Uploaded Source

File details

Details for the file kumquat-0.0.2.tar.gz.

File metadata

  • Download URL: kumquat-0.0.2.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.8.0 tqdm/4.41.1 CPython/3.7.3

File hashes

Hashes for kumquat-0.0.2.tar.gz
Algorithm Hash digest
SHA256 90ae11773a07dbc7102b507f192bd0d11ab47318a588b52027e3ddfe00b9a633
MD5 df0fae335c7b3328c7ace077c04182b9
BLAKE2b-256 a1d72aa80369ede2d98b7db63738b4ef18bfd536583f50342ad22af959c69bfa

See more details on using hashes here.

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