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.2.tar.gz
(4.7 kB
view details)
Built Distribution
File details
Details for the file sayopy-0.1.2.tar.gz
.
File metadata
- Download URL: sayopy-0.1.2.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1bf1145c147cfe92ec2c4de40ce94faa42b6a7a853c43680d0a77a14b996c191 |
|
MD5 | 3e1ae433981db8faa71ac01af0a2a1f6 |
|
BLAKE2b-256 | a75a721543515ed4b9ed260a0d361e5ba784451b2f90e7982f3300e1b0e9c372 |
File details
Details for the file sayopy-0.1.2-py2.py3-none-any.whl
.
File metadata
- Download URL: sayopy-0.1.2-py2.py3-none-any.whl
- Upload date:
- Size: 4.1 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 | c3b13867a8b21213f14b3beb8f20b07859757d1ca3195855a5535258baf2f1a6 |
|
MD5 | f1ba188e833dd8dd7821392294c91c86 |
|
BLAKE2b-256 | a9ebfe8a2181515ff22596cf457d6f3bdd13cba407d1b185a0a04bf5866d8371 |