Protobuf like client generation for python
Any plans to generate typed python client code or other languages? Right now I am manually generating pydantic objects (python equivalent to zod), client object using the convex python library. Any plans to transpile the Convex TS project to generate python client or other language syntax.
8 Replies
Thanks for posting in <#1088161997662724167>.
Reminder: If you have a Convex Pro account, use the Convex Dashboard to file support tickets.
- Provide context: What are you trying to achieve, what is the end-user interaction, what are you seeing? (full error message, command output, etc.)
- Use search.convex.dev to search Docs, Stack, and Discord all at once.
- Additionally, you can post your questions in the Convex Community's <#1228095053885476985> channel to receive a response from AI.
- Avoid tagging staff unless specifically instructed.
Thank you!
Yes! Today you need to do what you're doing from the output of
npx convex function-spec
, but the intentino of that export is to support code generation in many languages.Today this woudl be added to conve-helpers, where typescript and openAPI code generators live today https://github.com/get-convex/convex-helpers/blob/main/packages/convex-helpers/README.md#typescript-api-generation
GitHub
convex-helpers/packages/convex-helpers/README.md at main · get-conv...
A collection of useful code to complement the official packages. - get-convex/convex-helpers
man this product literally has an answer to everything 😂 take my 💸!
If you wanted to contribute a pydantic object generation to convex-helpers I think it'd be very welcome! Or if you could publish it as its own thing as a Python package.
@ballingt update here: i was playing with this and realized that the objects created with pydantic using https://docs.pydantic.dev/latest/integrations/datamodel_code_generator/ was too painful for now we are hand rolling the objects till there is a better and cleaner way to make the objects without the bizarre naming convention it makes. (the juice is not worth the squeeze for us).
datamodel-code-generator - Pydantic
Data validation using Python type hints
yeah if I were doing this I think it'd be something that spits out code by walking the function spec, all hand-rolled
@Sri @ballingt I'm facing the same decision. Was the pain just from the odd naming conventions or something else? Did you end up keeping the hand-rolled solution?