It is a simple and lightweight web framework built for learning and experimentation purposes.
Project description
BizAPI
A Lightweight Web Framework for Python
Contents
- A Simple Example
- Routing
- Features
A Simple Example
Installation using a Python package manager:
pip install BizAPI
from bizapi import BizAPI
from bizapi.types import Request, Response
app = BizAPI()
@app.route('/')
def home(request: Request, response: Response):
response.text = 'This is the home page'
gunicorn main:app
Function-Based Routing
@app.route('/')
def index(request: Request, response: Response):
response.text = "Hello World!"
Parameterized Routing
@app.route('/say-hello/{name}')
def sayhello(request: Request, response: Response, name: str):
response.text = f"Assalawma áleykum {name}"
Allowed Methods
@app.route('/article', methods=['POST'])
def create_article(request: Request, response: Response):
# Create a new article
pass
@app.route('/article', methods=['GET'])
def get_article(request: Request, response: Response):
# Get an article
pass
@app.post('/article')
def create_product(request: Request, response: Response):
# Create a new article
pass
@app.get('/article')
def get_product(request: Request, response: Response):
# Get an article
pass
Class-Based Routing
@app.route('/article')
class Article:
def get(request: Request, response: Response):
# Get an article
pass
def post(request: Request, response: Response):
# Create a new article
pass
Simple Router
def create_article(request: Request, response: Response):
response.text = "BizAPI is the best"
app.register_route('/article', create_article, ['POST'])
Features (To-Do)
Here's a list of upcoming features that will be included in BizAPI:
- Function-Based Routing
- Parameterized Routing
- Allowed Methods
- Class-Based Routing
- Simple Routes
- Exception Handler
- Templates
- Static Folder
- Custom Response
- Middleware
License
This project is licensed under the MIT License.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file bizapi-0.0.5.tar.gz.
File metadata
- Download URL: bizapi-0.0.5.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
02a691abc6ae00661f67f5d5e3ab79e7d43339fc08642dc8ec9e8bcfdca7b05e
|
|
| MD5 |
8bd0c2e2c7e1ef03a2ef3e837ebaae0e
|
|
| BLAKE2b-256 |
028c9ca94250b893a04e7b2dd2684ac37c7e64136699cb7e2f68462aa3ef9008
|
File details
Details for the file BizAPI-0.0.5-py3-none-any.whl.
File metadata
- Download URL: BizAPI-0.0.5-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c8109a01cd40c0a325e0e5316af3d546ac292834383ea5a642a443fb48fa796b
|
|
| MD5 |
3f92b1b4fda506610ef1aae04193ae38
|
|
| BLAKE2b-256 |
10396def4082161eb3af4ccd92ecc62faa90b714c1fbfb43bb9cad587f4c7f5b
|