I'm a big fan of Jinja2, which is a template engine. You would write a 
jinja template, and then write a Python to generate the fields like you 
want, pass it to the template to create the proto file for you.

Jared

On Friday, May 23, 2014 1:14:32 AM UTC-7, Ambrish Rawat wrote:
>
> I have been using protocol buffers to send strings of structured data 
> across a client and a server.
>
> Until now I had a fixed structure, so I defined a '.proto' file and used 
> the generated python stub to serialize the data.
>
> I now wish to generate the '.proto' file on the fly. Given some data 
> (structure unknown), a python list say, generate the corresponding proto 
> file.
>
> Is there a way to achieve this?
>
>
>

-- 
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 protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to