
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
- [SOLVED] Access ExecutionStatus of a fun...
I am calling a cloud function from the newest Flutter SDK 20.2.1with the `xasync: false` flag and get the result, but the `execution.status` is not a String and...
- What’s the current approach for always o...
Read that it’s not a thing out of the box, but what’s the possible setup here?
- Query.equal error
Hi guys. I'm using Appwrite Cloud, and I'm using version 21 of node-appwrite to benefit from transactions. The problem is I seem to be getting an error when I u...
