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.6.4.tar.gz
(1.4 MB
view details)
Built Distribution
File details
Details for the file happyx-4.6.4.tar.gz
.
File metadata
- Download URL: happyx-4.6.4.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 | fe3a62b89f1d662a5474894b6b2738ea69b281af17c6acadc94ca8a46ee945e6 |
|
MD5 | 03d9de32c1c22e17441211b5f9a17d1b |
|
BLAKE2b-256 | 9f316d24b73fbf38dfe4aabc8debf82c3088212799a4105f7d05037ef4dfaa83 |
File details
Details for the file happyx-4.6.4-py3-none-any.whl
.
File metadata
- Download URL: happyx-4.6.4-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 | fa71d5310ffea8e135fc9db6654b0d76cd8ceaa4b15b87c1ae72ce7c70166122 |
|
MD5 | 3a501f25c4b160ece3fc6d0aea709829 |
|
BLAKE2b-256 | 6b8e9d7598ae6cc535c5feb06cd11455509cbe43b846d288cfe16e650a566780 |