Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

an asynchronous version of the v2 API wrapper #44

Closed
bemxio opened this issue Jan 9, 2022 · 4 comments
Closed

an asynchronous version of the v2 API wrapper #44

bemxio opened this issue Jan 9, 2022 · 4 comments

Comments

@bemxio
Copy link

bemxio commented Jan 9, 2022

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 like AsyncOssapiV2 which would be used the same as the synchronous one, except that all endpoints would need to be awaited

@tybug
Copy link
Owner

tybug commented Jan 10, 2022

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)

@xFGhoul
Copy link

xFGhoul commented Jan 27, 2022

possibly separate them into folders so imports become like sync.OssapiV2 or async.OssapiV2

@tybug
Copy link
Owner

tybug commented Jan 28, 2022

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 b420040.

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 (weibeu/Async-OAuthlib#3) so I would need to either fix that or roll my own implementation.

In short, don't expect this anytime soon.

@tybug
Copy link
Owner

tybug commented Feb 21, 2023

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.

@tybug tybug closed this as completed Feb 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants