Async support for Python SDK

Hello,

We’re slowly migrating our code from manually constructed API calls to using your SDK, but a major drawback for us is having to call the API synchronously in the background.
Is there any chance you guys will come up with async support in the near future, similarly to what Web3.py does, for example?
It seem to me that it should be relatively easy with openapi generator that you’re using already.

1 Like

Hi @mikulas.mrva

Assuming you are looking to make multiple requests at once, would you be able to use threads to run parallel requests?

I could, but it’s quite a bit of extra work.
My context is that I’m fetching a lot of data from multiple sources, and everything else supports async so far (see dexguru-sdk, for example), so I can call asyncio.gather and run everything concurrently. So I can make those calls using wrappers such as sync_to_async, but native async support would be cleaner. So far the calls to Moralis API were done via aiohttp, so I would love to swap them in-place for the SDK.
I’m assuming I’m not the only person to ask for this, but that’s up to you to judge, of course, as the dev effort required would not be entirely trivial.

1 Like

Hi @mikulas.mrva

Yeah, understand the issue. Let me share this with the dev team.

1 Like

Hello @johnversus, any chance you have heard back from the devs, please?

Many thanks!

Hi @mikulas.mrva

There is no update on this as of now. The dev team is currently working on improving the API’s so this might be updated after that.

1 Like

+1 for async support on Python SDK.

1 Like