This repository has been archived by the owner. It is now read-only.
A framework for writing ASGI applications (experiment)
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
afiqah
docs
.gitignore
LICENSE
README.md
setup.py

README.md

afiqah

docs code style

Afiqah is a framework for writing ASGI (Asynchronous Server Gateway Interface) applications. It relies on the ASGI library/framework Starlette for many reusable ASGI components.

Note: This is a work in progress, mostly experimental at this time. Things will break and change.

Installation

pip install afiqah

Requirements: Python 3.6+, Starlette

Quickstart

In your terminal, type afiqah new to generate a simple "hello world" project that looks like this:

├── asgi.py
├── db_conf.json
└── test
    ├── __init__.py
    ├── app.py
    ├── conf.py
    └── models.py

Alternatively, you may run the example app without the default structure and configuration:

from afiqah.endpoints import HTMLEndpoint
from afiqah import Afiqah


app = Afiqah()


@app.route("/")
class Hello(HTMLEndpoint):
    async def get(self, request):
        return self.response("<html><body><h1>Hello, world!</h1></body></html>")

An ASGI server is required to run ASGI apps, you can use:

Run the app:

<server> asgi:app

Docs