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-3.8.9.tar.gz
(1.2 MB
view details)
Built Distribution
File details
Details for the file happyx-3.8.9.tar.gz
.
File metadata
- Download URL: happyx-3.8.9.tar.gz
- Upload date:
- Size: 1.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8a6dc65804b3c0fe79af89a604554b4862430943bfcc627c48423b523fec64bc |
|
MD5 | b4e771c8bc74cfb1dd00699021df52a9 |
|
BLAKE2b-256 | 23e23560854cc1c1104b62ba3393e54ad3595b218f2793d225067225b73bf8ba |
File details
Details for the file happyx-3.8.9-py3-none-any.whl
.
File metadata
- Download URL: happyx-3.8.9-py3-none-any.whl
- Upload date:
- Size: 1.2 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | db3e2a008aac16a40aa379ae70547316b4e81421f20fae1fceebd5c94c37f939 |
|
MD5 | 79c6c3d080ead5f37ec7a48db1bb5cee |
|
BLAKE2b-256 | 386f9900df794dcd26422b5cd7480ca4c523eb7de146eb0f3c98c3fe48dfe9fe |