NANO : A Nano Web Framework
Nano is an Express inspired nano web framework which is under development. Currently, it has features of adding routes, controllers and sending API responses (Refer the example blog app for reference). Defining models with custom field types is also available but is under development.
Status : Under developement
To run example app
$ pip3 install -r requirements.txt
$ python3 main.py run:<appname>
Documentation
Step 1: Install nanoAPI and create folder structure
$ pip3 install nanoAPI
$ touch models.py
$ touch controllers.py
$ touch routes.py
$ touch main.py
Step 1: Install nanoAPI and create folder structure
# models.py
from nanoAPI.db import model
class User(model.Model):
username = model.StringType('username', max_length=50, min_length=4, unique=True, required=True)
# define your model here
Step 2: Define your controllers
# controllers.py
from nanoAPI.handler import Response
def index(req):
# define your controller here
return Response(status=200, data={"msg": "message"})
Step 3: create a router and assign controllers with routes
# routes.py
from nanoAPI.handler import Router
from .controllers import index
router = Router()
router.get("/", index)
Step 4: create nanoAPI app and assemble your router and models
# main.py
from nanoAPI import nanoAPI, run
from .routes import router
from .models import User
api = nanoAPI()
api.set_router('/api', router)
api.set_models(User)
run(api)
Step 5: Boot your models to db and run the server
$ python3 main.py run:db
$ python3 main.py run:api
Refer the example blog app for folder structure. Working on a better documentation
Metadata
Release files for nanoAPI 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nanoAPI-0.5.0.tar.gz | 10.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nanoAPI-0.5.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 23.6 kB
Release files / nanoAPI-0.5.0.tar.gz
| Download URL | nanoAPI-0.5.0.tar.gz |
|---|---|
| Size | 10.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
24a04a7ed641de6ca2b0429f01c54f3dcf2ad127f5ced50da916bb6168b821bc
|
|
BLAKE2b-256 checksum How to use checksums |
597c065cbd42d754836f192048d4e8be0b47106d7f355bce52c6da9384c99b59
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.5
|
Release files / nanoAPI-0.5.0-py3-none-any.whl
| Download URL | nanoAPI-0.5.0-py3-none-any.whl |
|---|---|
| Size | 13.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
778ae67e8b2bd3a373a617f89330a9ac7a1cd3649a047114930127e82d49aabd
|
|
BLAKE2b-256 checksum How to use checksums |
a198cba4240a9453b032cb2b605ccef960cd7c49b4628b2a2f0c7e1bf332f31d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.3.0 pkginfo/1.7.0 requests/2.22.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.5
|