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.4.tar.gz
(4.7 kB
view details)
Built Distribution
File details
Details for the file sayopy-0.1.4.tar.gz
.
File metadata
- Download URL: sayopy-0.1.4.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 | 0f334548a110f93f346ad418d7e940f12221a8f607889407e80d279496f84a71 |
|
MD5 | 3c3ccbe5e09dd00effa4950a96edf7ed |
|
BLAKE2b-256 | d82cbcde09e37ff8527d672b6b5be6ac717fcaa94dae30ae10faa961b10f57a8 |
File details
Details for the file sayopy-0.1.4-py2.py3-none-any.whl
.
File metadata
- Download URL: sayopy-0.1.4-py2.py3-none-any.whl
- Upload date:
- Size: 4.0 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 | b232bf9dd8ca33ce81db0388d4adca507907f07fb4dee9dc1db22f3fddbb892f |
|
MD5 | 555e639336b627a70b409bc907ebb594 |
|
BLAKE2b-256 | 14762e0b08b82021bcde0bc7bb4fae23e6becd1829fa705ec91977fcf2336fdf |