
Good day 👋
I am making a Python-based Appwrite function and I see that generally, this is done by accepting a file structured like this:
def main(context): return context.res.send("Hello World")
I was wondering if there is any information on what type/structure this "context" object has? Can it perhaps be imported from an SDK of be defined somewhere? I would love to know this for creating tests.


@ideclon thanks for the response. I already saw this page and guess I should have formulated the question differently.
Is there some Python definition of the context object? I.e. such that I can make a script like this:
def main(context: RuntimeContext):
return context.res.send("")```
In other words; this context object must have some class or data structure which is not specified in the documentation. This is relevant because I might want to write unittests that send such a context object, preferably without mocking an implementation and rather using the actual thing.

Python SDK doesn't have types, but there is a open issue an PR to implement it: https://github.com/appwrite/sdk-for-python/issues/43

Looking the PR seems like it doesn't include types for the context, you can comment the issue giving your feedback

We've been wanting to add better type support for open runtimes...not sure when we'll be able t oget to it

Alright, thanks for the info!

Just for future reference, I found the Context
object definition here https://github.com/open-runtimes/open-runtimes/blob/main/runtimes/python-3.10/src/server.py#L47-L70
This is what I was looking for 😀 thx again for the pointers

[SOLVED] Python context object
Recommended threads
- Error
I'm trying to get sellerId using account.get() in my appwrite function and this is the error message I'm getting: "Failed to send notification to seller 6865bf...
- Is there a timeframe for updating dart r...
Dart 3.5 is already one year old, and the following versions have introduced very important features for the language. Is there a roadmap or timeframe for when...
- Error
I'm trying to get sellerId using account.get() in my appwrite function and this is the error message I'm getting: "Failed to send notification to seller 6865bf...
