Closed bemxio closed 1 year ago
yep, this has been on my mind for a while now. I'll write an async version at some point (or someone is free to beat me to it, as always)
possibly separate them into folders so imports become like sync.OssapiV2
or async.OssapiV2
I'd prefer if the async version was called AsyncOssapiV2
to clearly mark it as async, and the sync version continue to be the default OssapiV2
.
I did start working on this, and you can see my (extremely rough and currently erroring) progress on the async branch, namely commit https://github.com/circleguard/ossapi/commit/b420040989fc8b9982989355b0fba71f607335f6.
It turned out to be a pain to extract out the async portions of the code cleanly. The async version of the requests oauthlib is also broken (https://github.com/weibeu/Async-OAuthlib/issues/3) so I would need to either fix that or roll my own implementation.
In short, don't expect this anytime soon.
I've implemented this in v3.1.0. You can import it as OssapiAsync
and use it identically to Ossapi
. Read more on the docs: https://circleguard.github.io/ossapi/async.html.
it would be quite useful for website backends, with logins and discord bots, that also want to authenticate users in a way https://async-oauthlib.readthedocs.io/en/latest/ there's an async oauth module, that seems to fit the features needed for it and for requests themself,
aiohttp
would be nice it could be named something likeAsyncOssapiV2
which would be used the same as the synchronous one, except that all endpoints would need to beawait
ed