HappyX web framework bindings for Python 🐍
Project description
HappyX
Python Bindings For HappyX Web Framework 🔥
Get Started
Install
You can install HappyX via pypi
:
pip install happyx
Usage
Hello World
from happyx import new_server
app = new_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 new_server, JsonResponse, HtmlResponse, FileResponse
app = new_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-2.8.0.tar.gz
(1.7 MB
view details)
Built Distribution
File details
Details for the file happyx-2.8.0.tar.gz
.
File metadata
- Download URL: happyx-2.8.0.tar.gz
- Upload date:
- Size: 1.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1aa1d3addc450e09e80a646dfe97be2a0fa6073c5a87336a7b0d01329e5e471e |
|
MD5 | 63fb69bd96d5e2a92cca973acf0d3f8f |
|
BLAKE2b-256 | c185b3a2bd8844533375ae8e572daedbc881feee076641d523faebb161f1f210 |
File details
Details for the file happyx-2.8.0-py3-none-any.whl
.
File metadata
- Download URL: happyx-2.8.0-py3-none-any.whl
- Upload date:
- Size: 1.7 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 37d5457f5e015affde1562fef43ca550097ff7c140a2c525306b75a40adc274e |
|
MD5 | c73f68717f4ef58285ae87392320bb4a |
|
BLAKE2b-256 | 45a8d1f7d589105fcb5f81fc2d2ab296473b7c910cf0bce0e59c40229606d93b |