Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kesha1225/kumquat
citrus web framework
https://github.com/kesha1225/kumquat
kumquat web-framework
Last synced: 2 months ago
JSON representation
citrus web framework
- Host: GitHub
- URL: https://github.com/kesha1225/kumquat
- Owner: kesha1225
- Created: 2020-01-26T13:10:01.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2020-06-04T16:24:33.000Z (over 4 years ago)
- Last Synced: 2024-10-14T09:40:28.884Z (3 months ago)
- Topics: kumquat, web-framework
- Language: Python
- Homepage:
- Size: 50.8 KB
- Stars: 8
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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](./examples).
```python3
from kumquat.application import Kumquat
from kumquat.response import TextResponse, JsonResponse, HTMLResponse
from kumquat.request import Request
from kumquat.response import SimpleResponse, TemplateResponse
import logginglogging.basicConfig(level="INFO")
app = Kumquat()
@app.index()
async def index(request: Request, response: SimpleResponse):
response.status_code = 418
response.set_headers({"shue": "ppsh"})
return HTMLResponse("hello
")@app.get("//")
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()
```