Allin is an experimental asynchronous web framework.
MIT License
You can help this project get better by creating an issue or PR. Thank you for your time!
Table of Contents:
Allin
is heavily inspired by Flask, Starlette & Falcon.
I'm just curious ๐ง
Yup, I'm curious about how a web application based on ASGI works.
It may not yet fully comply with the ASGI application specifications as documented. But, for the main features like route mapping, HTTP responses, error handling, parsing the request body it's there.
...and I want to build my own framework from scratch so I know how the application works.
Literally, the "framework parts" weren't built from scratch as I also used third party modules and some "parts from other sources" were used as references.
This is part of the journey
Lifespan Protocol
HTTP Protocol
HTTP Headers
HTTP Request
HTTP Responses
HTTP Middleware
Routing
@get
, @post
, @put
, etc. are available.Extension
Websocket Support
app
and request
object instances globally)JSON
and MessagePack
requests are supported out of the box (thanks to msgspec)application/x-www-form-urlencoded
or multipart/form-data
)@get
, @post
, @put
, etc. are available.Here is an example application based on the Allin
framework and I'm sure you are familiar with it.
from allin import Allin, JSONResponse
app = Allin()
@app.route("/")
async def index():
return JSONResponse({"message": "Hello World!"})
app
variable is the ASGI application instance./
on the line app.route(...)
index()
function to handle the /
route.{"message": "Hello World!"}
That's it! looks familiar right?
Want more? check out other sample projects here
git clone --depth 1 https://github.com/aprilahijriyan/allin.git
cd allin
Need https://python-poetry.org/ installed on your device
poetry build
pip install ./dist/*.whl
pip
Currently I just published the pre-release version v0.1.1a0
. So, maybe you need to install it with the --pre
option. Example:
pip install --pre allin