Asita is a web application framework for python.

Overview

What is Asita ?

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.

License

How to install Asita ?

Install this package using pip

$ pip install asita

Documentation

Get started

Exemple

from asita.application import Application

# creating application instance
app = Application()

# callback when web server is ready
def listen_callback(error):
    if error:
        raise error
    print(f"Server listening on port 1000.")

# listen the webserver on port (for instance port 1000)
app.listen(1000, lambda error: 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 :-)
def home(request, response):
    pass

# "/" is the default path
app.all("/", lambda req, res: home(req, res))

To see more example, check the example file.

Request class

Attributs

Name Description
headers headers of the request
session client session
path the url's path
request_type type of request
server_address address of the requested server
server_version version of the requested server
protocol_version version of the HTTP protocol
body the body content of the POST request
query url params

Methods

Name Parameters Description
get(value) value: string get a header of the request
accepts() none get types which are accepted

Response class

Methods

Name Parameters Description
status(code) code: HttpResponses return the response's state
set_header(key, value) key: string, value: string add/update headers
send(data, type?, encoded?) data: object, type: string, encoded: boolean, is_asset: boolean send response
json(data) data: dict write json on a page
render(path) path: string render html file.
end() none stop the current request

? means that it is optionnal

Sessions class

Name Parameters Description
add() none create new empty session
all() none get all sessions
has(sessionId) key: string verify if a session exists
get(sessionId) key: string get a session by id
delete(sessionId) key: string delete session by id
radnom_session_id @Static method none get all sessions

Session class

Name Parameters Description
get_session_id none get the id of the session
set(key, value) key: string, value: string add data to the client session
has(key) key: string verify if client session has the selected data
get(key) key: string get data from client session
delete(key) key: string delete data from client session
all() none get client session data

Enumerations

HttpMethods

HTTP Methods
GET
POST
PUT
DELETE
PATCH
HEAD
ALL

HttpResponses

Client side

Response types Codes
OK 200
NO_CONTENT 204
UNAUTHORIZED 401
FORBIDDEN 403
NOT_FOUND 404
BAD_REQUEST 400

Server side

Response types Codes
INTERNAL_SERVER_ERROR 500

License

MIT LICENSE

You might also like...
Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed.

Tornado Web Server Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed. By using non-blocking ne

Async Python 3.6+ web server/framework | Build fast. Run fast.
Async Python 3.6+ web server/framework | Build fast. Run fast.

Sanic | Build fast. Run fast. Build Docs Package Support Stats Sanic is a Python 3.6+ web server and web framework that's written to go fast. It allow

bottle.py is a fast and simple micro-framework for python web-applications.

Bottle: Python Web Framework Bottle is a fast, simple and lightweight WSGI micro web-framework for Python. It is distributed as a single file module a

Pyramid - A Python web framework

Pyramid Pyramid is a small, fast, down-to-earth, open source Python web framework. It makes real-world web application development and deployment more

The Modern And Developer Centric Python Web Framework. Be sure to read the documentation and join the Slack channel questions: http://slack.masoniteproject.com
The Modern And Developer Centric Python Web Framework. Be sure to read the documentation and join the Slack channel questions: http://slack.masoniteproject.com

NOTE: Masonite 2.3 is no longer compatible with the masonite-cli tool. Please uninstall that by running pip uninstall masonite-cli. If you do not unin

Free and open source full-stack enterprise framework for agile development of secure database-driven web-based applications, written and programmable in Python.

Readme web2py is a free open source full-stack framework for rapid development of fast, scalable, secure and portable database-driven web-based applic

Sierra is a lightweight Python framework for building and integrating web applications
Sierra is a lightweight Python framework for building and integrating web applications

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.
Flask Sugar is a web framework for building APIs with Flask, Pydantic and Python 3.6+ type hints.

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文档

Fast⚡, simple and light💡weight ASGI micro🔬 web🌏-framework for Python🐍.

NanoASGI Asynchronous Python Web Framework NanoASGI is a fast ⚡ , simple and light 💡 weight ASGI micro 🔬 web 🌏 -framework for Python 🐍 . It is dis

Releases(v0.2.5-alpha)
  • v0.2.5-alpha(Nov 10, 2021)

  • v0.2.0-apha(Nov 7, 2021)

    Fixed:

    1. Session : reworked all session system
    2. Issue with routes : you can't add a lot of HTTP method for one route
    3. Removed methods and properties
    4. Adding Sessions class and Session class instead of CookieParser class
    5. Adding examples

    [-] CookieParser [+] Session, Sessions

    Source code(tar.gz)
    Source code(zip)
  • v0.1.0-alpha(Nov 6, 2021)

Owner
Mattéo
French developer
Mattéo
WebSocket and WAMP in Python for Twisted and asyncio

Autobahn|Python WebSocket & WAMP for Python on Twisted and asyncio. Quick Links: Source Code - Documentation - WebSocket Examples - WAMP Examples Comm

Crossbar.io 2.4k Jan 06, 2023
Python AsyncIO data API to manage billions of resources

Introduction Please read the detailed docs This is the working project of the next generation Guillotina server based on asyncio. Dependencies Python

Plone Foundation 183 Nov 15, 2022
The web framework for inventors

Emmett is a full-stack Python web framework designed with simplicity in mind. The aim of Emmett is to be clearly understandable, easy to be learned an

Emmett 796 Dec 26, 2022
Online Boutique is a cloud-native microservices demo application

Online Boutique is a cloud-native microservices demo application. Online Boutique consists of a 10-tier microservices application. The application is

Matt Reider 1 Oct 22, 2021
Asita is a web application framework for python.

What is Asita ? 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

Mattéo 4 Nov 16, 2021
Flask-Potion is a RESTful API framework for Flask and SQLAlchemy, Peewee or MongoEngine

Flask-Potion Description Flask-Potion is a powerful Flask extension for building RESTful JSON APIs. Potion features include validation, model resource

DTU Biosustain 491 Dec 08, 2022
Lemon is an async and lightweight API framework for python

Lemon is an async and lightweight API framework for python . Inspired by Koa and Sanic .

Joway 29 Nov 20, 2022
Endpoints is a lightweight REST api framework written in python and used in multiple production systems that handle millions of requests daily.

Endpoints Quickest API builder in the West! Endpoints is a lightweight REST api framework written in python and used in multiple production systems th

Jay Marcyes 30 Mar 05, 2022
PipeLayer is a lightweight Python pipeline framework

PipeLayer is a lightweight Python pipeline framework. Define a series of steps, and chain them together to create modular applications

greaterthan 64 Jul 21, 2022
The core of a service layer that integrates with the Pyramid Web Framework.

pyramid_services The core of a service layer that integrates with the Pyramid Web Framework. pyramid_services defines a pattern and helper methods for

Michael Merickel 78 Apr 15, 2022
Django Ninja - Fast Django REST Framework

Django Ninja is a web framework for building APIs with Django and Python 3.6+ type hints.

Vitaliy Kucheryaviy 3.8k Jan 02, 2023
Klein - A micro-framework for developing production-ready web services with Python

Klein, a Web Micro-Framework Klein is a micro-framework for developing production-ready web services with Python. It is 'micro' in that it has an incr

Twisted Matrix Labs 814 Jan 08, 2023
A tool for quickly creating REST/HATEOAS/Hypermedia APIs in python

ripozo Ripozo is a tool for building RESTful/HATEOAS/Hypermedia apis. It provides strong, simple, and fully qualified linking between resources, the a

Vertical Knowledge 198 Jan 07, 2023
Flask + Docker + Nginx + Gunicorn + MySQL + Factory Method Pattern

This Flask project is reusable and also an example of how to merge Flask, Docker, Nginx, Gunicorn, MySQL, new: Flask-RESTX, Factory Method design pattern, and other optional dependencies such as Dyna

Facundo Padilla 19 Jul 23, 2022
O SnakeG é um WSGI feito para suprir necessidadades de perfomance e segurança.

SnakeG O SnakeG é um WSGI feito para suprir necessidadades de perfomance e segurança. Veja o que o SnakeG possui: Multiprocessamento de requisições HT

Jaedson Silva 1 Jul 02, 2022
Try to create a python mircoservice framework.

Micro current_status: prototype. ... Python microservice framework. More in Document. You should clone this project and run inv docs. Install Not now.

修昊 1 Dec 07, 2021
Pulumi-checkly - Checkly Pulumi Provider With Python

🚨 This project is still in very early stages and is not stable, use at your own

Checkly 16 Dec 15, 2022
Bionic is Python Framework for crafting beautiful, fast user experiences for web and is free and open source

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

⚓ 0 Mar 05, 2022
Bromelia-hss implements an HSS by using the Python micro framework Bromélia.

Bromélia HSS bromelia-hss is the second official implementation of a Diameter-based protocol application by using the Python micro framework Bromélia.

henriquemr 7 Nov 02, 2022
Asynchronous HTTP client/server framework for asyncio and Python

Async http client/server framework Key Features Supports both client and server side of HTTP protocol. Supports both client and server Web-Sockets out

aio-libs 13.2k Jan 05, 2023