-
Notifications
You must be signed in to change notification settings - Fork 11
How to use it #4
Comments
How to use it? |
Some basic information will be helpful. At least someone else will prepare the documentation |
There is one function...
coronavirus/coronavirus/__init__.py Line 74 in a4ad601
There really isn't more to it. |
Is not clear how to use the get_cases function? Can you provide and example? |
Sorry, I don't want to be rude; but what part is unclear? |
When I create the session, and used it as argument I got this: from coronavirus import get_cases session = aiohttp.ClientSession() Traceback (most recent call last): |
This is all async @oskrgab... Your example is sync... |
Untested example code, dry-coded straight in this GitHub comment box: import asyncio
import aiohttp
from coronavirus import get_cases
async def main():
session = aiohttp.ClientSession()
cases = await get_cases(session)
for case in cases:
print(f"Cases in {case.country}: {case.confirmed}")
await session.close()
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(main()) |
It would be nice to find that code at the READ.ME. |
covid |
No description provided.
The text was updated successfully, but these errors were encountered: