Aquilify is an ASGI (Asynchronous Server Gateway Interface) framework designed to facilitate the development of web applications with Python. It enables efficient handling of HTTP requests, WebSocket connections, middleware processing, and exception handling in an asynchronous environment.
Project description
Documentation: https://www.aquilify.vvfin.in/
Aquilify
Aquilify is an ASGI (Asynchronous Server Gateway Interface) framework designed to facilitate the development of web applications with Python. It enables efficient handling of HTTP requests, WebSocket connections, middleware processing, and exception handling in an asynchronous environment.
Introduction
Aquilify leverages Python's async capabilities to provide a robust and scalable infrastructure for building web applications. It includes features such as request routing, middleware support, WebSocket handling, and response management.
Key Features
-
HTTP Request Handling: Aquilify efficiently processes incoming HTTP requests and provides a structured approach for defining routes and handling various HTTP methods (GET, POST, PUT, DELETE, etc.).
-
WebSocket Support: The framework supports WebSocket connections, allowing bidirectional communication between clients and servers.
-
Middleware Processing: Aquilify facilitates the use of middleware functions to preprocess requests, perform authentication, logging, or modify responses before sending them back.
-
Exception Handling: The framework includes mechanisms to handle exceptions raised during request processing, enabling graceful error responses.
Installation
pip install aquilify
You'll also want to install an ASGI server, such as netix, uvicorn, daphne, or hypercorn.
$ pip install netix
- Netix is an ASGI Web server gateway for Aquilify, built on the top of asynchronous programming.
A Smiple Example
# save this as main.py
from aquilify.core import Aquilify
app = Aquilify()
@app.route('/')
async def home():
return {"message": "Welcome to Aquilify"}
Terminal
$ netix --deubg main:app
* Starting Netix v1.12 (cpython 3.11.6, linux)
-----------------------------------------------------------------------
Options:
run(host=127.0.0.1, port=8080, reuse_port=True, worker_num=1, reload=True, app=lo:app, log_level=DEBUG)
-------------------------------- ---------------------------------------
[2023-11-15 22:25:18] Starting Netix as an ASGI server for: Aquilify
[2023-11-15 22:25:18,079] INFO: lifespan: startup
[2023-11-15 22:25:18,080] INFO: lifespan.startup.complete
[2023-11-15 22:25:19] Netix (ASGI) (pid 18513) is started at 127.0.0.1 port 8080
Dependencies
- [
aiofiles
][aiofile] - Required if you want to use theStaticMIddleware
orFile based Opertation
. - [
jinja2
][jinja2] - Required if you want to useTemplateResponse
. - [
python-multipart
][python-multipart] - Required if you want to support form parsing, withrequest.form()
. - [
itsdangerous
][itsdangerous] - Required forSessionMiddleware
andCSRF
support.
You can install all of these with pip3 install aquilify[full]
.
Aquilify is BSD licensed code.
Designed & crafted with care.
— ⭐️ —
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.