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.app 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.3.tar.gz
(4.7 kB
view details)
Built Distribution
File details
Details for the file sayopy-0.1.3.tar.gz
.
File metadata
- Download URL: sayopy-0.1.3.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 | d578f650d8019b3bcaf2eb873d69c4bb7dbba3ddb14a621913baec53051544b5 |
|
MD5 | 1d2b014055bdb4399db468f68256bc52 |
|
BLAKE2b-256 | 76ade7df904107c9e094a2338985991c465c1b135f5218c6895ef1758720b1a1 |
File details
Details for the file sayopy-0.1.3-py2.py3-none-any.whl
.
File metadata
- Download URL: sayopy-0.1.3-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 | d37d734ecdc7048221fbf561b976f92034434139dc686c3df1f8215f67beaddc |
|
MD5 | 5ead680b6c35110659179b3344d05ef6 |
|
BLAKE2b-256 | a14b5365d14cea0d7867467e0657fc8d7b664bef7bc507d92b9988fed54f796c |