{"repo":"criccomini/proto-schema-parser","free":true,"listed":false,"github":"https://github.com/criccomini/proto-schema-parser","clone":"git clone https://github.com/criccomini/proto-schema-parser.git","description":"A pure Python protobuf parser","language":"Python","stars":64,"topics":["abstract-syntax-tree","antlr","bufbuild","parser","protobuf","protocol-buffers","python","data-engineering","lexer","lexer-parser"],"license":"MIT","category":"data-pipelines","readme_excerpt":"Protobuf Schema Parser Protobuf Schema Parser is a pure-Python library that parses and writes Protobuf schemas to and from an abstract syntax tree (AST). The library uses proto schema parser.parser.Parser to parse the CST into an AST. The proto schema parser.generator.Generator class converts the AST back into a CST (a Protobuf schema string). The lexer and parser are autogenerated from Buf's ANTLR lexer and parser grammar files. Features - ✅ proto2 and proto3 support - ✅ protobuf editions support (edition 2023, edition 2024) - ✅ message, field, enum, optional, required, repeated - ✅ import, package, oneof, map, and option - ✅ group and extend (in proto2) - ✅ service, rpc, and stream - ✅ line and block comment preservation Installation Install the package via pip: Usage To parse a protobuf schema, create a Parser object and call the parse method: This will return an AST object ( ast.File ) representing the parsed protobuf schema. To write the AST back to a protobuf schema, create a Generator object and call the generate method: The proto variable now contains the string: Using Protobuf Editions The library also supports protobuf editions, which provide more flexibility than proto2/proto3 syntax: Supported editions: - edition = \"2023\"; - Edition 2023 spec - edition = \"2024\"; - Edition 2024 spec Contributing I welcome contributions! - Submit a PR and I'll review it as soon as I can. - Open an issue if you find a bug or have a feature request. License Protobuf Schema Parser is l","default_branch":null,"files":null,"tree":[],"storefront":"/r/criccomini","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/criccomini/proto-schema-parser/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}