Python protocol buffers for the rest of us
Archived. The repository is read-only: no more fixes or releases will come.
pip install protoletariatProtocol Buffers for the Rest of Us
Motivation
Are you annoyed by having to fix the absolute imports generated by protoc?
If so, then protoletariat is the tool for you.
protoletariat has one goal: fixing the broken imports for the Python code
generated by protoc.
See https://github.com/protocolbuffers/protobuf/issues/1491 for the discussion that inspired this tool.
Installation
| Artifact | Status | Installation Command |
|---|---|---|
| PyPI Package | pip install protoletariat | |
| Conda Package | conda install protoletariat -c conda-forge | |
| Docker Image | ∅ | docker pull ghcr.io/cpcloud/protoletariat:latest |
Note: the conda-forge package version may lag behind the other artifacts by a few hours.
Usage
protoletariat is designed to be run as a post-processing step after running
protoc. It operates directly on the generated code.
Example
Here's an example of how to use the tool, called protol:
- Create a few protobuf files
// thing1.proto
syntax = "proto3";
import "thing2.proto";
package things;
message Thing1 {
Thing2 thing2 = 1;
}