Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code generation/client package(s) #86

Open
rwb27 opened this issue Nov 21, 2024 · 0 comments
Open

Code generation/client package(s) #86

rwb27 opened this issue Nov 21, 2024 · 0 comments
Labels
roadmap Plans for the future

Comments

@rwb27
Copy link
Collaborator

rwb27 commented Nov 21, 2024

At present, ThingClient instances are generated at runtime based on Thing Descriptions. This works, but doesn't allow type checking or autocompletion. My aspiration is to enable both of these, which probably requires code generation.

The way I see this working is that labthings_fastapi should provide code that will generate a client module based on a Thing subclass. This could be integrated into the build system of a Python package, such that the built package contains a client module - or even releases a second client package (without the hardware/server dependencies). This client module would include a ThingClient subclass with all the actions and properties of the Thing.

Dependencies of things on each other would ideally go via ThingClient objects, so the generated code should be able to be used for server-side DirectThingClients as well as HTTP based ThingClients.

@rwb27 rwb27 added the roadmap Plans for the future label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
roadmap Plans for the future
Projects
None yet
Development

No branches or pull requests

1 participant