Metadata-Version: 2.1
Name: asgi-tools
Version: 0.25.0
Summary: Is a toolkit to build ASGI applications faster
Home-page: https://github.com/klen/asgi-tools
Author: Kirill Klenov
Author-email: horneds@gmail.com
License: MIT
Project-URL: Documentation, https://klen.github.io/asgi-tools
Project-URL: Source code, https://github.com/klen/asgi-tools
Project-URL: Issue tracker, https://github.com/klen/asgi-tools/issues
Keywords: asyncio,trio,asgi,asgi tools,request,response
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Framework :: AsyncIO
Classifier: Framework :: Trio
Requires-Python: >=3.6
Requires-Dist: multidict
Requires-Dist: yarl
Requires-Dist: http-router (>=0.7.1)
Requires-Dist: sniffio
Requires-Dist: async-generator ; python_version < "3.7"
Requires-Dist: cached-property ; python_version < "3.8"
Requires-Dist: typing-extensions ; python_version < "3.8"
Provides-Extra: build
Requires-Dist: bump2version ; extra == 'build'
Requires-Dist: twine ; extra == 'build'
Requires-Dist: wheel ; extra == 'build'
Requires-Dist: idna (<3) ; extra == 'build'
Provides-Extra: docs
Requires-Dist: sphinx ; extra == 'docs'
Requires-Dist: pygments-style-tomorrow ; extra == 'docs'
Requires-Dist: sphinx-rtd-theme ; extra == 'docs'
Provides-Extra: examples
Requires-Dist: uvicorn ; extra == 'examples'
Requires-Dist: websockets ; extra == 'examples'
Requires-Dist: jinja2 ; extra == 'examples'
Requires-Dist: httpx ; extra == 'examples'
Provides-Extra: tests
Requires-Dist: aiofile ; extra == 'tests'
Requires-Dist: anyio ; extra == 'tests'
Requires-Dist: asgi-lifespan ; extra == 'tests'
Requires-Dist: pytest ; extra == 'tests'
Requires-Dist: pytest-mypy ; extra == 'tests'
Requires-Dist: trio ; extra == 'tests'

.. image:: https://raw.githubusercontent.com/klen/asgi-tools/develop/.github/assets/asgi-tools.png
   :height: 100
   :width: 100

.. _description:

**asgi-tools** -- Is a toolkit to build ASGI applications faster

.. _badges:

.. image:: https://github.com/klen/asgi-tools/workflows/tests/badge.svg
    :target: https://github.com/klen/asgi-tools/actions
    :alt: Tests Status

.. image:: https://github.com/klen/asgi-tools/workflows/docs/badge.svg
    :target: https://klen.github.io/asgi-tools
    :alt: Documentation Status

.. image:: https://img.shields.io/pypi/v/asgi-tools
    :target: https://pypi.org/project/asgi-tools/
    :alt: PYPI Version

.. image:: https://img.shields.io/pypi/pyversions/asgi-tools
    :target: https://pypi.org/project/asgi-tools/
    :alt: Python Versions

.. _documentation:

**Documentation is here**: https://klen.github.io/asgi-tools

----------

.. _features:

**Features:**

- Supports `Asyncio`_ and `Trio`_ libraries
- ``Request``                 -- Parse ASGI scope, get url, headers, cookies, read a request's data/json/form-data
- ``Response``                -- Send HTTP (text, html, json, stream, file, http errors) responses
- ``ResponseWebsocket``       -- Work with websockets
- ``RequestMiddleware``       -- Parse a scope and insert the parsed request into the scope
- ``ResponseMiddleware``      -- Parse responses and convert them into ASGI messages
- ``RouterMiddleware``        -- Route HTTP requests
- ``LifespanMiddleware``      -- Process a lifespan cycle
- ``StaticFilesMiddleware``   -- Serve static files from URL prefixes
- ``asgi_tools.tests.TestClient`` -- A test client with websockets support to test asgi applications
- ``App``                     -- A simple foundation for ASGI apps

.. _contents:

.. contents::

.. _requirements:

Requirements
=============

- python >= 3.6

.. _installation:

Installation
=============

**asgi-tools** should be installed using pip: ::

    pip install asgi-tools

A Quick Example
===============

Save this to ``app.py``:

.. code-block:: python

    from asgi_tools import App

    app = App()

    @app.route('/')
    async def hello(request):
        return "Hello World!"

Run it with `uvicorn`

.. code-block:: sh

   $ uvicorn app:app


.. _bugtracker:

Bug tracker
===========

If you have any suggestions, bug reports or
annoyances please report them to the issue tracker
at https://github.com/klen/asgi-tools/issues

.. _contributing:

Contributing
============

Development of the project happens at: https://github.com/klen/asgi-tools

.. _license:

License
========

Licensed under a `MIT license`_.


.. _links:

.. _Asyncio: https://docs.python.org/3/library/asyncio.html
.. _Trio: https://trio.readthedocs.io/en/stable/index.html
.. _klen: https://github.com/klen
.. _MIT license: http://opensource.org/licenses/MIT



