Awesome Open Source
Awesome Open Source

============================ Klein, a Web Micro-Framework

.. image:: :target: :alt: Build Status .. image:: :target: :alt: Code Coverage .. image:: :target: :alt: Requirements Status .. image:: :target: :alt: Python Version Compatibility

Klein is a micro-framework for developing production-ready web services with Python. It is 'micro' in that it has an incredibly small API similar to Bottle <>_ and Flask <>. It is not 'micro' in that it depends on things outside the standard library. This is primarily because it is built on widely used and well tested components like Werkzeug <> and Twisted <>_.

A Klein bottle <>_ is an example of a non-orientable surface, and a glass Klein bottle looks like a twisted bottle or twisted flask. This, of course, made it too good of a pun to pass up.

Klein's documentation can be found at Read The Docs <>_.


This is a sample Klein application that returns 'Hello, world!', running on port 8080.

.. code-block:: python

from klein import run, route

def home(request):
    return 'Hello, world!'

run("localhost", 8080)


klein is hosted on GitHub <>_ and is an open source project that welcomes contributions of all kinds from the community, including:

  • code patches,
  • documentation <>_ improvements,
  • bug reports <>_,
  • reviews for contributed patches <>_.

For more information about contributing, see the contributor guidelines <>_.

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
python (53,503
async (487
web-framework (146
micro-framework (45
twisted (30