Metadata-Version: 2.0
Name: yield2await
Version: 0.0.1
Summary: Transform your python code to use async/await (PEP 492)
Home-page: https://github.com/alxpy/yield2await
Author: Oleksandr Kuzmenko
Author-email: UNKNOWN
License: MIT
Description-Content-Type: UNKNOWN
Keywords: yield from asyncio coroutines with async await
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Requires-Python: >=3.5
Requires-Dist: astor (==0.6.2)

|PyPI| |python versions| |license|

yield2await
===========

Transform your python code from old syntax with ``yield from`` to use ``async``/``await`` (PEP 492).

Usage
~~~~~

.. code:: bash

    $ pip install yield2await
    $ yield2await <path> [-i <ignore-path>]

Before
~~~~~~

.. code:: python

    @asyncio.coroutine
    def handler(request):
        session = yield from get_session(request)
        session['last_visit'] = time.time()
        with (yield from self.dbengine) as conn:
            ret = yield from conn.execute(query)
            user = yield from ret.fetchone()
        return web.Response(body=b'OK')

After
~~~~~

.. code:: python

    async def handler(request):
        session = await get_session(request)
        session['last_visit'] = time.time()
        async with self.dbengine as conn:
            ret = await conn.execute(query)
            user = await ret.fetchone()
        return web.Response(body=b'OK')

Contribution
~~~~~~~~~~~~

Feel free to contribute. Just do RP.

Caution
~~~~~~~

This is a very alpha, check the changes manually before commit.

.. |PyPI| image:: https://img.shields.io/pypi/v/yield2await.svg
   :target: https://pypi.python.org/pypi/yield2await
.. |python versions| image:: https://img.shields.io/badge/python-3.5%2C%203.6-blue.svg
.. |license| image:: https://img.shields.io/apm/l/vim-mode.svg
   :target: https://github.com/alxpy/yield2await/blob/master/LICENSE


