Skip to content

orhanemree/tea

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🍵 Tea

Micro HTTP library in Python for building web servers.

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

License

About

🍵 Micro HTTP library in Python for building web servers.

Topics

Resources

License

Stars

Watchers

Forks

Languages