pyowm
pyowm copied to clipboard
Support for async API calls
This would leverage Python 3.5's async/await features
API calls could just be async functions (aka coroutine functions) that pyowm returns and then get executed on an eventloop provided by client code
note: asyncio is part of the python std library only from 3.5 so 3.4 doesn't feature it (but asyncio can be imported as an external dependency)
Design solution
Make PyOWM 2.x sync functions a "sub-case" of async functions as stated here: https://stackoverflow.com/questions/53521716/enhance-synchronous-software-api-to-allow-asynchronous-consuming/53523001#53523001
Take a look here for sync/async library calls handling: https://hackernoon.com/controlling-python-async-creep-ec0a0f4b79ba
This is something I'd be interested in. Any specific reason it's now wontfix?
@Harmon758 No user interest so far.. and then you shouted ;-) I don't want to rule this feature out if it eventually proves useful !
I'll throw my hat into the game, I am interested as my bot I plan on using OWM with is already async.
@csparpa I personally would appreciate if you mind reopening this
@aitorllj93 @y2kbadbug @Harmon758 open again :)
Are you able to collaborate on this?
So currently I implemented this on my own vanilla script using Python Treq to make the asynchronous calls. It is written on top of Twisted.
https://pypi.org/project/treq/
This might not be ideal for this project as the level of dependencies it can add, but when I get some free time I'll be happy to poke at a solution for this project.