You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm planning to move over a couple of applications I maintain to Appwrite, and while in the process of moving I noticed the python-sdk client is non-asynchronous. Mainly due to requests being used as the http client.
I've already got a p.o.c fork and opened a PR #453 which passes all tests. This is a very initial version and I definitely make some time to optimize it further, but I think it's a good starting point.
There are a number of changes.
Breaking: Moving from requests to httpx. Httpx is mostly requests-compatible as well contains both a sync and async client.
I removed requests to keep the dependency count low, but I can understand if certain people are unable to install.. Maybe we can publish a spealized version of the sdk with async support? e.g: pip install appwrite[async]?
Async Client and functions is available under appwrite.aio and any I/O related functions must be called with await.
There is a lot of room to further optimize, such as maybe using AnyIO for users who use Trio instead of asyncio.
👀 Have you spent some time to check if this issue has been raised before?
@ms7m, can your description be added to appwrite/sdk-for-python#26 and then we close out this issue as a duplicate since there's a longer history/conversation in that issue?
🔖 Feature description
An async client for the python-sdk.
🎤 Pitch
I'm planning to move over a couple of applications I maintain to Appwrite, and while in the process of moving I noticed the python-sdk client is non-asynchronous. Mainly due to
requests
being used as the http client.A little bit of background: The applications I maintain are mostly FastAPI-based and they recommend any I/O based libraries to be asynchronous for better performance..
I've already got a p.o.c fork and opened a PR #453 which passes all tests. This is a very initial version and I definitely make some time to optimize it further, but I think it's a good starting point.
There are a number of changes.
Breaking: Moving from
requests
tohttpx
. Httpx is mostly requests-compatible as well contains both a sync and async client.pip install appwrite[async]
?Async Client and functions is available under
appwrite.aio
and any I/O related functions must be called withawait
.There is a lot of room to further optimize, such as maybe using
AnyIO
for users who use Trio instead of asyncio.👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: