Micro HTTP library with WebSocket support for Python.
Project description
🍵 Tea
Micro HTTP library for Python.
Tea has Express.js-like syntax (which is web framework for JavaScript) with it's callback function syntax, Request, Response and URL objects. Got a lot of reference from popular web frameweorks like Flask, FastAPI and Express.js. Tea is like lightweight mix of their best features.
Finally, the 418 I am a teapot code comes true. Enjoy!
Quick Start
$ pip install tea-web
Hello, World!
Simple Hello, World! example in Tea. See /examples for more example.
# app.py
from tea import Tea
app = Tea()
def handle_index(req, res):
res.send("Hello, World!")
app.get("/", handle_index)
app.listen() # listening port 8080
Pros
- Lightweight. No external requirement and the package cost is only ~10 KB.
- More control over the Request and Response objects. This objects can be used outside the library structure.
- Easy to use and helpful on handling simple HTTP requests.
Cons
- Limited features and methods.
- No template engine.
- Callback function syntax is not really Pythonic without decorators. (Done on purpose but true.)
- Not sure if it's ready for production.
Documentation
- See DOCUMENTATION.md.
License
- Licensed under the MIT License.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tea-web-0.6.0.tar.gz.
File metadata
- Download URL: tea-web-0.6.0.tar.gz
- Upload date:
- Size: 10.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
393af712f2587b607c88374771b76cb4e598d3a7b4a81a8528bf21647e4d20e8
|
|
| MD5 |
85568a422ec7e8ec455d10e0c1d685ee
|
|
| BLAKE2b-256 |
2195ee7186b4e7be2026c57434eb1cbfc4cac51e0687bb0f849e298d2a6ab52a
|
File details
Details for the file tea_web-0.6.0-py3-none-any.whl.
File metadata
- Download URL: tea_web-0.6.0-py3-none-any.whl
- Upload date:
- Size: 11.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9fd4e3ab01e3c69866db83dec52764be1559981755135d54ea02169ba0ab1e82
|
|
| MD5 |
7837efb6a9fe48357fe68e18c3a2a525
|
|
| BLAKE2b-256 |
03a1e5be1b7637a997a0d7f857c08043c6b24e71dac8fe47b3b55d16860027a1
|