appwrite/sdk-generator

๐Ÿš€ Feature: Async Client for Python

Closed this issue ยท 2 comments

ms7m commented

๐Ÿ”– 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 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?

  • I checked and didn't find similar issue

๐Ÿข Have you read the Code of Conduct?

@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?

Closing due to inactivity and duplicate