Open datacubeR opened 4 months ago
You need to do something like this, because async functionality needs to be in an async function:
import asyncio
import aiograpi
async def test():
ACCOUNT_USERNAME = "myuser"
ACCOUNT_PASSWORD = "mypassword"
cl = Client()
await cl.login(ACCOUNT_USERNAME, ACCOUNT_PASSWORD)
user_id = await cl.user_id_from_username(ACCOUNT_USERNAME)
medias = await cl.user_medias(user_id, 20)
async def main():
await test()
if __name__ == '__main__':
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Try HikerAPI SaaS with a free trial https://hikerapi.com/p/KhMxYMSn
Describe the bug Running the README example simply just don't work.
To Reproduce
Traceback
Expected behavior A working Script
Screenshots Show above...
Desktop (please complete the following information):
Additional context I'm just getting familiar with the API so a more descriptive error would be very beneficial.