Sometimes I use python rather than protoc to generate, for example:

python -m grpc.tools.protoc \
    --proto_path=. \
    --proto_path=${GOOGLEAPIS_DIR} \
    --python_out=python \
    --grpc_python_out=python \
    ${PROTO_NAME}.proto


So, crudely wondering whether you could create within your script using
grpc.tools.protoc.  Haven't considered doing this previously -- so merely a
pointer to one area that might (or not) be useful to explore --

Good luck!


On Tue, Jul 7, 2020 at 9:44 AM Taran Deshpande <[email protected]> wrote:

>  Hello,
>
> I want to write a python script that will parse a proto message without
> having the definition compiled beforehand. Basically, I want the script to
> take in a .proto definition as an argument at runtime and compile it using
> protoc so the script can parse any protobuf message. Is there a python
> module available to invoke protoc?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/protobuf/e6d2011f-d4fc-417f-aefd-fffb03a29a1co%40googlegroups.com
> <https://groups.google.com/d/msgid/protobuf/e6d2011f-d4fc-417f-aefd-fffb03a29a1co%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/protobuf/CAEbFGqsQptPJJvod_-yC7%2BSxbf%2B%3D%2BcVN4k0Fq4wM%3DOtVjg9oNw%40mail.gmail.com.

Reply via email to