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 generator #64

Open
eigenein opened this issue May 31, 2019 · 7 comments
Open

Code generator #64

eigenein opened this issue May 31, 2019 · 7 comments
Labels

Comments

@eigenein
Copy link
Owner

For 3rd-party APIs people often have messages defined via *.proto files which are "ground truth". It requires additional work to keep Python data classes in sync with *.proto. Let's a make a "code generator" which translates *.proto files into *.py modules

@reorx
Copy link

reorx commented Aug 3, 2019

It'll be a good starting point to write the generator based on this project: https://github.com/dropbox/mypy-protobuf/blob/master/python/protoc-gen-mypy

The mypy style annotations in pyi files it generates are actually pretty close to your @dataclass decorated message classes.

@reorx
Copy link

reorx commented Aug 3, 2019

An off-topic suggestion BTW, since the package is called pure-protobuf, it's better to name this git project the same.

@tlc
Copy link

tlc commented Oct 27, 2021

Or generate *.proto files for others from the dataclasses?

@mbednarski
Copy link

Is it still relevant? My project would benefit from such functionality, so I might try to implement it.

@eigenein
Copy link
Owner Author

@mbednarski I'd assume so. Feel free to submit a pull request anyway

@EricCousineau-TRI
Copy link

dumb q - is there already code to do the reverse? *.py -> *.proto (for sharing outward?)

@eigenein
Copy link
Owner Author

@EricCousineau-TRI no, there wasn't such a thing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants