yandex_tracker_client
yandex_tracker_client copied to clipboard
asyncio support
Blocking requests in 2019...? Welcome to the future :)
async with aiohttp.ClientSession() as session:
async with session.get('http://httpbin.org/get') as resp:
print(resp.status)
print(await resp.text())
Hello! Where are a huge amount of python 2 services which are using this library, as soon as they move to python 3 we will be able to move to async syntax.
For now you can use
loop = asyncio.get_event_loop()
loop.run_in_executor(executor, some_func)
Thanks, but I have already use yatracker with blackjack and hookers :)
from yatracker import YaTracker
tracker = YaTracker(org_id=..., token=...)
async def foo():
# create issue
issue = await tracker.create_issue('New Issue', 'KEY')
# get issue
issue = await tracker.get_issue('KEY-1')
# update issue (just pass kwargs)
await tracker.edit_issue('KEY-1', description='Hello World')
# get list with transitions
transitions = await issue.get_transitions()
# execute first transition in list
transition = transitions[0]
await transition.execute()