Metadata-Version: 2.2
Name: klein
Version: 24.8.0
Summary: werkzeug + twisted.web
Home-page: https://github.com/twisted/klein
Maintainer: Twisted Matrix Laboratories
Maintainer-email: twisted@python.org
License: MIT
Keywords: twisted flask werkzeug web
Classifier: Environment :: Web Environment
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Topic :: Internet :: WWW/HTTP :: Dynamic Content
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.7
Description-Content-Type: text/x-rst
License-File: LICENSE
License-File: AUTHORS
Requires-Dist: attrs>=20.1.0
Requires-Dist: hyperlink
Requires-Dist: incremental
Requires-Dist: Tubes
Requires-Dist: Twisted>=16.6
Requires-Dist: typing_extensions; python_version < "3.10"
Requires-Dist: Werkzeug
Requires-Dist: zope.interface
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: keywords
Dynamic: license
Dynamic: maintainer
Dynamic: maintainer-email
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

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

.. image:: https://github.com/twisted/klein/workflows/CI/badge.svg?branch=trunk
    :target: https://github.com/twisted/klein/actions
    :alt: Build Status
.. image:: https://codecov.io/github/twisted/klein/coverage.svg?branch=trunk
    :target: https://codecov.io/github/twisted/klein?branch=trunk
    :alt: Code Coverage
.. image:: https://img.shields.io/pypi/pyversions/klein.svg
    :target: https://pypi.org/project/klein
    :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 <https://bottlepy.org/docs/dev/index.html>`_ and `Flask <https://flask.palletsprojects.com/>`_.
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 <https://werkzeug.palletsprojects.com/>`_ and `Twisted <https://twisted.org>`_.

A `Klein bottle <https://en.wikipedia.org/wiki/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 <https://klein.readthedocs.org>`_.


Example
========

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

.. code-block:: python

    from klein import run, route

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

    run("localhost", 8080)


Contribute
==========

``klein`` is hosted on `GitHub <https://github.com/twisted/klein>`_ and is an open source project that welcomes contributions of all kinds from the community, including:

- code patches,
- `documentation <https://klein.readthedocs.org/>`_ improvements,
- `bug reports <https://github.com/twisted/klein/issues>`_,
- reviews for `contributed patches <https://github.com/twisted/klein/pulls>`_.

For more information about contributing, see `the contributor guidelines <https://github.com/twisted/klein/tree/trunk/CONTRIBUTING.rst>`_.
