Asita is a web application framework for python. It is designed to be easy to use and be more easy for javascript users to use python frameworks because it is based on express-js framework.
fromasita.applicationimportApplication# creating application instanceapp=Application()
# callback when web server is readydeflisten_callback(error):
iferror:
raiseerrorprint(f"Server listening on port 1000.")
# listen the webserver on port (for instance port 1000)app.listen(1000, lambdaerror: listen_callback(error))
Router class
Methods
Name
Parameters
Description
use(path, router)
path: str, callback: Router
create a router with default path like "/profile" and put some routes like "/add"
all(path, callback)
path: string, callback: function
Routes an HTTP request, where all is the HTTP method such as GET, PUT, POST, OATCH, DELETE, HEAD
post(path, callback)
path: string, callback: function
Routes HTTP POST requests
get(path, callback)
path: string, callback: function
Routes HTTP GET requests
put(path, callback)
path: string, callback: function
Routes HTTP PUT requests
patch(path, callback)
path: string, callback: function
Routes HTTP PATCH requests
delete(path, callback)
path: string, callback: function
Routes HTTP DELETE requests
head(path, callback)
path: string, callback: function
Routes HTTP HEAD requests
Application class
Methods
Name
Parameters
Description
define_asset(name, directory)
name: string, directory: string
Define the asset directory access
listen(port, callback)
port: integer, callback: function
start listening a port
Create a route
Exemple
# some awesome things check request and response methods :-)defhome(request, response):
pass# "/" is the default pathapp.all("/", lambdareq, res: home(req, res))
A lightweight Python framework for building and Integrating Web Applications. Sierra is a Python3 library for building and integrating web applications with HTML and CSS using simple enough syntax. You can develop your web applications with Python, taking advantage of its functionalities and integrating them to the fullest.
Flask Sugar is a web framework for building APIs with Flask, Pydantic and Python 3.6+ type hints. check parameters and generate API documents automatically. Flask Sugar是一个基于flask,pyddantic,类型注解的API框架, 可以检查参数并自动生成API文档