Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

shaldengeki/py_proto

Repository files navigation

py_proto

This is a Python-based protobuf parser. It is intended to serve as a reference implementation and is not production-ready.

pre-commit.ci status Build status

Usage

Right now, the primary way to use this as a library in your Bazelified Python code.

Mount this repo in your Bazel workspace, then add @py_proto//src/util:parser as a dependency:

py_library(
    name = "your_python_code",
    # ...
    deps = [
        "@py_proto//src/util:parser",
    ]
)

Then, in your Python code, use the parser:

from src.util.parser import ParseError, Parser
with open("your.proto", "r") as proto_file:
    parsed_proto = Parser.loads(proto_file.read())

print(parsed_proto.syntax)

Development

We support building & running via Bazel. See the TODO.md for what's on the roadmap.

Bazel

Do bazel test //....

About

python protobuf parser

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published