Skip to main content

Maintenance Percentage of issues still open

Ario - Python Lightweight Micro Framework

flask-based framework which is working with jinja2 and wrekzeug

This framework has been developed by Wish Team for web development purpose. This project is maintained by this team and hope make web development easier and faster.

Motivation

The main concept of this framework is like flask. but it's only work like a dispatcher and you could easily use any library you want. you are not dependant to any 3rd specific libraries and also you do not have any regex in matching for your url which may cause ReDos to your system. you could specify the result of your response with just a decorator like @html or @jinja which is help for focusing on your development only.

Instalation

Install and update using pip:

pip install ario

Usage

First of all you should import classes that you want. RouterController, Endpoint, Application should be imported and json, html, setup_jinja, jinja, redirect, forbidden, ok are arbitrary.

from werkzeug.serving import run_simple
from werkzeug.middleware.shared_data import SharedDataMiddleware
from ario import RouterController, Endpoint, Application, json, jinja2
from ario.status import forbidden, ok

For seting up your template:

setup_jinja("./templates")

For instance if we want to define two endpoint that one of them is json and the latter is jinja, we should define them as below:

control = RouterController(debug=True)

@control.route(method=["GET", "POST", "HEAD"], route="/")
class ExampleEndpoint(Endpoint):
    @json
    def get(request, response):
        data = {
            "name": "john",
            "family_name": "doe",
            "age": 21,
            "phone_number": "12345678"
        }
        return data
@control.route(method=["GET", "POST"], route="/user/$id")
class ExampleEndpoint(Endpoint):
    @jinja("base.html")
    def get(request, response, id):
        params = {"my_string": id, "my_list": [0, 1, 2]}
        return params

remeber for using jinja decorator, you should insert a base.html file in template folder After all, we make a socket to our port use werkzeug:

if __name__ == '__main__':
    app = Application(control)
    app = SharedDataMiddleware(app, {
        '/static': os.path.join(os.path.dirname(__file__), 'templates/static')
    })
    print('Demo server started http://localhost:5000')
    run_simple('127.0.0.1', 5000, app, use_debugger=True, use_reloader=True)

You could run your code easily by just typing python yourfile.py

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ario-0.6.8.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ario-0.6.8-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file ario-0.6.8.tar.gz.

File metadata

  • Download URL: ario-0.6.8.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

File hashes

Hashes for ario-0.6.8.tar.gz
Algorithm Hash digest
SHA256 1010153120f59911b7e9085d294d04406128ce35648105c41b05579ce36deec4
MD5 8e8b9a730be2c8d7d3685c5bf35213fb
BLAKE2b-256 8376c3613f584bbb043ff690fbddf5facb1156207a68431ad1ca7c89c90007c3

See more details on using hashes here.

File details

Details for the file ario-0.6.8-py3-none-any.whl.

File metadata

  • Download URL: ario-0.6.8-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.8.5

File hashes

Hashes for ario-0.6.8-py3-none-any.whl
Algorithm Hash digest
SHA256 c5c00eda5370d43d8ffc3fc1b7c65d6a677af7459a3886cb59c1aa9368120674
MD5 03076d5153928f4054e820fdf07a6b72
BLAKE2b-256 27f027610bfc24caa59c4c733c845d17a542c4c245717afb314972633a48f4a5

See more details on using hashes here.

Release history Release notifications | RSS feed

0.6.9

2 files

This release

0.6.8 This release

2 files

0.6.7

2 files

0.6.6

2 files

0.6.5

2 files

0.6.4

2 files

0.6.3

2 files

0.6.2

2 files

0.6.1

2 files

0.6.0

2 files

0.5.0

2 files

0.4.8

2 files

0.4.7

2 files

0.4.6

2 files

0.3.6

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page