HappyX web framework bindings for Python 🐍
Project description
HappyX
Python Bindings For HappyX Web Framework 🔥
Getting Started ✌
Installing 📥
You can install HappyX via pypi
:
pip install happyx
Usage 🔌
Hello World 👋
from happyx import Server
app = Server('127.0.0.1', 5000) # host and port are optional params
@app.get('/')
def home():
return "Hello world!"
app.start()
JSON/HTML/File Responses 🛠
from happyx import Server, JsonResponse, HtmlResponse, FileResponse
app = Server()
@app.get('/json')
def json_resp():
return JsonResponse(
{'key': 'value', 'arr': [1, 2, 3, 4, 5]},
status_code=200 # also available headers: dict param
)
@app.get('/html')
def html_resp():
return HtmlResponse(
'<h1>HTML Response!</h1>',
status_code=200 # also available headers: dict param
)
@app.get('/file')
def file_resp():
return FileResponse('my_cool_icon.png')
app.start()
Read more in User Guide
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
happyx-4.5.2.tar.gz
(1.4 MB
view details)
Built Distribution
File details
Details for the file happyx-4.5.2.tar.gz
.
File metadata
- Download URL: happyx-4.5.2.tar.gz
- Upload date:
- Size: 1.4 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0dcffc8b6333779711b27c6ae2f91b74bc19c0fe64f3916bcfbbbe7db406204b |
|
MD5 | 9f7503d07c0735e6ff502c02f556b826 |
|
BLAKE2b-256 | 2d8abc89bba7505ad4d36e510fea7cafd549f0db3c238ab44f6ffc032867a4e0 |
File details
Details for the file happyx-4.5.2-py3-none-any.whl
.
File metadata
- Download URL: happyx-4.5.2-py3-none-any.whl
- Upload date:
- Size: 1.4 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bf9f58877cb93d578616ac15ca1769fc52d6157e30fa37b8957dc2cd88c39f5b |
|
MD5 | 5440534515125606775aabcb05d7f4eb |
|
BLAKE2b-256 | 15431d49da0c8754349fd17f9be7cfcb34a8dcb4f62abba90325d412b3c22010 |