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.9.2.tar.gz
(1.6 MB
view details)
Built Distribution
File details
Details for the file happyx-2.9.2.tar.gz
.
File metadata
- Download URL: happyx-2.9.2.tar.gz
- Upload date:
- Size: 1.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7ed7e41207096f6d287ed7e09d6f9fb1113fbe8dca9d7bbc75cb9ec0cb1c0f3 |
|
MD5 | 6708886966200ad1adf6cdc621aaaaf8 |
|
BLAKE2b-256 | 11508e9028e8cb03b36d2d7c22ece60071f85c20eeb0a694571445b32ed59795 |
File details
Details for the file happyx-2.9.2-py3-none-any.whl
.
File metadata
- Download URL: happyx-2.9.2-py3-none-any.whl
- Upload date:
- Size: 1.6 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 | 7c06cd3f4c1a4279229368c683a774c1a5289fb57fe4cd103105ec60a815ac5b |
|
MD5 | 8df109c4aab7eeaa5148aee1e562985d |
|
BLAKE2b-256 | 80016235a05508417f7d189d367f2eed1c6e0eb16f603dc5c1689d72d3dfc5f2 |