sdk-generator icon indicating copy to clipboard operation
sdk-generator copied to clipboard

🚀 Feature: Async Client for Python

Open ms7m opened this issue 3 years ago • 1 comments

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

  • [x] I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

ms7m avatar May 24 '22 13:05 ms7m

@ms7m, can your description be added to https://github.com/appwrite/sdk-for-python/issues/26 and then we close out this issue as a duplicate since there's a longer history/conversation in that issue?

stnguyen90 avatar Oct 14 '22 16:10 stnguyen90

Closing due to inactivity and duplicate

stnguyen90 avatar Nov 02 '22 16:11 stnguyen90