Python Web Framework built for learning purposes.
Project description
SayoPy: Python Web Framework built for learning purposes
SayoPy is a Python web framework built for learning purposes.
It's a WSGI framework and can be used with any WSGI application server such as Gunicorn.
Instalition
pip install sayopy
Basic usage:
from SayoPy.api import SayoPy
app = SayoPy()
@app.route("/home")
def home(request, response):
response.text = "Hello from the Home page"
@app.route("/hello/name")
def greating(request, response, name):
response.text = f"Hello, {name}!"
@app.route("/books")
class Books:
def get(self, request, response):
response.text = "Books page"
def post(self, request, response):
response.text = "Endpoint to create a book"
@app.route("/template")
def template_handler(request, response):
response.html = app.template(
"index.html", context={"title": "Best Framework", "name": "Askar Saparov"}
)
@app.route("/json")
def json_handler(request, response):
response_data = {"name": "Askar Saparov", "age": 25}
response.json = response_data
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
SayoPy-0.1.1.tar.gz
(3.1 kB
view details)
Built Distribution
File details
Details for the file SayoPy-0.1.1.tar.gz
.
File metadata
- Download URL: SayoPy-0.1.1.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50a71e2e667c7a67a008b677c6880adfb71664a670eba81e8b35fb3144a45dbe |
|
MD5 | 28ecc8f61dae84a5304fb53943a9de37 |
|
BLAKE2b-256 | a91070d55aa7d2dcf2f4d3f23eb0c302f48df7035dfd67f003f9bce283064531 |
File details
Details for the file SayoPy-0.1.1-py2.py3-none-any.whl
.
File metadata
- Download URL: SayoPy-0.1.1-py2.py3-none-any.whl
- Upload date:
- Size: 1.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a4748cd6b2e0140ef76346388528a912df60228d7881626257571f3012e29a7 |
|
MD5 | d3b751e87a5dc018b20eaaf90f01e479 |
|
BLAKE2b-256 | 7e4b511e294bcb07cf40685ee2286fedd3d5ebdb9e958e3ed8fcd7c7511d15f8 |