Skip to content

Nimond/Ancalagon

codecov Actions Status PyPI version

Ancalagon - The blackest ASGI web framework

pip install ancalagon


Hello world:

from ancalagon import App
from ancalagon.responses import JSONResponse


async def hello(request):
    return JSONResponse({'hello': 'world'})


app = App()
app.route('/', hello)

Powerful mechanism for managing middlewares:

You have App middlewares, that run on each route

app = App(middlewares=[])

You have route middlewares

app.route('/', hello, middlewares=[])

And you can ignore App middleware on specific route

app.route('/', hello, ignore_middlewares=[])

Usecase:

In your app you need authorization validation on all routes except login. You set validation_middleware (check cookies or headers) to App middlewares, and set it to ignore_middlewares of login route.



Inspired by:
    Burzum
    Summoning
    Balrog
    Windir
    Gorgoroth