Skip to content

🚀 Feature: Async Client for Python #452

Closed as not planned
Closed as not planned
@ms7m

Description

@ms7m

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions