Skip to content

twisted/klein

Folders and files

NameName
Last commit message
Last commit date
Feb 18, 2025
Dec 22, 2023
Mar 25, 2025
Feb 24, 2025
May 23, 2023
Mar 12, 2024
Feb 24, 2025
Aug 12, 2024
Aug 8, 2021
Feb 24, 2025
May 5, 2023
Oct 27, 2020
Oct 20, 2023
Dec 27, 2020
Jun 1, 2022
Dec 22, 2023
May 22, 2023
May 3, 2023
Dec 20, 2023
Aug 12, 2024
Jan 26, 2014
Oct 30, 2024
Oct 30, 2024

Repository files navigation

Klein, a Web Micro-Framework

Build Status Code Coverage 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.

Example

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

from klein import run, route

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

run("localhost", 8080)

Contribute

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

For more information about contributing, see the contributor guidelines.