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.6.2.tar.gz
(1.2 MB
view details)
Built Distribution
File details
Details for the file happyx-3.6.2.tar.gz
.
File metadata
- Download URL: happyx-3.6.2.tar.gz
- Upload date:
- Size: 1.2 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d80274636c03498bdfb4edd17712eb51bd4471562b18cdcb77ad9af24a53293 |
|
MD5 | 51013f134eea0d52edd89113f75734ae |
|
BLAKE2b-256 | 89b859a02d5de7293e559a0e2bffeda6b3caad7b2aaea1fb100afe9d0e5e5a37 |
File details
Details for the file happyx-3.6.2-py3-none-any.whl
.
File metadata
- Download URL: happyx-3.6.2-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.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72d15717c001257447125665809a8f6837e77dbf41c04de5d8861b63c9f41dc4 |
|
MD5 | b9b5d7c15ad966ea6f72f2c9e0b2a3ab |
|
BLAKE2b-256 | dfabdf8538b9032843b8646de7d6fe45c4873bd9806d9ee70661f0ed902a6a21 |