Skip to main content
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.

Release files for klein 24.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for klein 24.8.0
File Size Uploaded
klein-24.8.0.tar.gz 104.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for klein 24.8.0
File Interpreter ABI Platform
klein-24.8.0-py2.py3-none-any.whl Python 2, Python 3 none any Details

Total release size: 198.2 kB

Release files / klein-24.8.0.tar.gz

Download URL klein-24.8.0.tar.gz
Size 104.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1eef4f583c4f8ef4fc57d8b57753fe6e8935501eb36497bb574064e80e3d0b15
BLAKE2b-256 checksum
How to use checksums
325570e08b134db00f2e9b5c00f6df6e4f1c13b46041b15451e8f3c28bd74908
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.5

Release files / klein-24.8.0-py2.py3-none-any.whl

Download URL klein-24.8.0-py2.py3-none-any.whl
Size 93.8 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
90e15b74f8c842a1519ea0b4e473e97fb8265c046d8b900815008c7614c59173
BLAKE2b-256 checksum
How to use checksums
b4cca5b41def4b6bfa81aa0a1bb71360cb63d9d7158d63c9368666411c100eb8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.12.5
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page