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.
fromasitaimportApplication# 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))
Application class
Methods
Name
Parameters
Description
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
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))
Slumber is a Python library that provides a convenient yet powerful object-oriented interface to ReSTful APIs. It acts as a wrapper around the excellent requests library and abstracts away the handli
Dazzler is a Python async UI/Web framework built with aiohttp and react. Create dazzling fast pages with a layout of Python components and bindings to update from the backend.
Bionic is fast. It's powered core python without any extra dependencies. Bionic offers stateful hot reload, allowing you to make changes to your code and see the results instantly without restarting