Skip to main content
PyCon US is happening May 14th-22nd in Pittsburgh, PA USA.  Learn more

Decorator that turns async generator functions into async context managers.

Project description

PyPI version GitHub release Build Status codecov GitHub license

Decorator that turns async generator functions into async context managers.

Installation

Supported versions of python: ``3.6+`` (since async generators were introduced in python 3.6)

pip install asyncio-contextmanager

Usage

Usage is straightforward and simple:

from aiocontext import async_contextmanager

@async_contextmanager
async def foo():
    yield 'Foo!'

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page