encore icon indicating copy to clipboard operation
encore copied to clipboard

Client code gen support: Python

Open bih opened this issue 3 years ago • 3 comments
trafficstars

For some advanced codebases, they may use Python in some parts and wish to slowly migrate to Encore. In this case, we'd benefit from being able to generate a Python client that they can use to talk to their Encore app as they slowly migrate.

See code files here for the TypeScript implementation:

bih avatar Sep 20 '22 17:09 bih

@bih Interested please assign

gagandeepp avatar Oct 15 '22 12:10 gagandeepp

Hi @gagandeepp, that's great! Happy to assign it to you, but do note this is something that needs design work before we can start implementation. So the first step is to sketch out what the API should look like.

If you are happy to take a stab at that, let me know and we can definitely assign this to you. Thanks!

eandre avatar Oct 15 '22 12:10 eandre

Hey @eandre from looking at the generated typescript code this seems relatively simple but would require a couple choices about tooling.

For HTTP requests, are you imaging using the standard library urllib.request API or a third-party package such as urllib3, httpx, aiohttp, or requests? Is an asynchronous interface a priority?

Similarly, for input data types, there's the standard library dataclass or packages such as attrs or pydantic that are very common for these things.

Note the links in the initial comment out of date and this code is now found at:

  • https://github.com/encoredev/encore/tree/main/internal/clientgen

zanieb avatar Dec 04 '22 22:12 zanieb