Emmett55 is a Python micro web framework designed with simplicity in mind.
from emmett55 import App, request, response
from emmett55.tools import service, requires
app = App(__name__)
def is_authenticated():
return request.headers.get("api-key") == "foobar"
def not_authorized():
response.status = 401
return {"error": "not authorized"}
@app.route("/", methods='get')
@requires(is_authenticated, otherwise=not_authorized)
@service.json
async def index():
return {"message": "hello world"}
Emmett55 is based on Emmett and shares the following features with it:
- application and modules
- routing
- request/response/session/websocket helpers
- the pipeline
- services (JSON only)
- caching (except for disk cache)
- HTML code generation
- extensions
- testing client
- CLI (with the
emmett55
command)
Consequentially, Emmett55 doesn't include:
- the ORM
- the authentication system
- the templating system
- the internationalization system
- validations
- forms utilities
- XML services
- disk caching
- the mailer
- the debugger
Typical use-cases for picking Emmett55 over Emmett are:
- the lack of need of the upper-mentioned missing features
- the desire to use different libraries in place of the Emmett components, like SQLAlchemy or Jinja
While we're still in the process of developing Emmett55 documentation, the Emmett one can be examined – with the caviat to replace emmett
with emmett55
when mentioned and keep in mind the upper-mentioned list of non-included features.
Emmett55 is released under the BSD License.