gunnarG
Convex Community9mo ago
5 replies
gunnar

Typed Python clients

Currently we're trying to experiment with replacing our NATS service with Convex's realtime mechanism. So the Python service, would subscribe to changes in Convex, simplifying our stack significantly.

We've set up Convex in the Python client and it is working fine, the subscriptions too. The only thing is that we don't have any types for the subscribed values. Currently for example in the following code example, the tasks varible just has a type of "ConvexValue" instead of "Task" or something like that:

for tasks in convexClient.subscribe("queries/tasks:get"):
print(tasks)

The reason we have typings in the NATS setup is because we're using a yml spec file for that in combination with asyncapi-codegen.

Is there some way to generate typed Python types/clients for Convex? Or would I have to write my own parser/generator?
Was this page helpful?