I use protoc to generate python output from a series of .proto files. These files are organized in a directory structure, but on the output side, I just want them to be flat. Using --python_out means that protoc will automatically figure out the name of the output, which is specifically what I do not want.

I realize I can potentially have an intermediate step where I generate the DescriptorSet files using my preferred name, and then just turn the compiled DescriptorSets into Python output. This also actually helps me because I need these descriptor files anyway for use in a non-stock protobuf encoder/decoder, so this way I only need to generate these files once.

My question is, if I have a directory full of compiled DescriptorSets, how can I make Python output from that? I see the --descriptor_set_in option in protoc, but it is poorly documented and I cant find any examples.

0 Answers