This repository was archived by the owner on Jun 9, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +47
-4
lines changed Expand file tree Collapse file tree 5 files changed +47
-4
lines changed Original file line number Diff line number Diff line change 1+ # Getting started
2+
3+ ## Install protoc
4+
5+ The betterproto2 compiler is a plugin of ` protoc ` , you first need to [ install] ( https://grpc.io/docs/protoc-installation/ ) it.
6+
7+ ## Install ` betterproto2_compiler `
8+
9+ It is possible to install ` betterproto2_compiler ` using pip:
10+
11+ ```
12+ pip install betterproto2_compiler
13+ ```
14+
15+ ## Compile a proto file
16+
17+ Create the following ` example.proto ` file.
18+
19+ ``` proto
20+ syntax = "proto3";
21+
22+ package helloworld;
23+
24+ message HelloWorld {
25+ string message = 1;
26+ }
27+ ```
28+
29+ You should now be able to compile it using:
30+
31+ ```
32+ mkdir lib
33+ protoc -I . --python_betterproto2_out=lib example.proto
34+ ```
Original file line number Diff line number Diff line change 11Home
22====
33
4- Welcome to betterproto2-compiler 's documentation!
4+ Welcome to ` betterproto2_compiler ` 's documentation! This site will guide you through the steps needed to install and use the betterproto2 compiler.
Original file line number Diff line number Diff line change 1- site_name : Betterproto2 Compiler
1+ site_name : Betterproto2
22site_url : https://betterproto.github.io/python-betterproto2-compiler/
33theme :
44 name : material
55 palette :
66 primary : deep orange
77 accent : deep orange
88
9+ features :
10+ - navigation.tabs
11+
12+ nav :
13+ - Betterproto2 : https://betterproto.github.io/python-betterproto2/
14+ - Betterproto2 compiler :
15+ - index.md
16+ - Getting started : getting-started.md
17+
918plugins :
1019- mkdocstrings
1120
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ pytest = "^6.2.5"
3434protobuf = " ^4"
3535
3636[tool .poetry .scripts ]
37- protoc-gen-python_betterproto = " betterproto2_compiler.plugin:main"
37+ protoc-gen-python_betterproto2 = " betterproto2_compiler.plugin:main"
3838
3939[tool .ruff ]
4040extend-exclude = [" tests/output_*" ]
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ async def protoc(
4646):
4747 path : Path = Path (path ).resolve ()
4848 output_dir : Path = Path (output_dir ).resolve ()
49- python_out_option : str = "python_betterproto_out " if not reference else "python_out"
49+ python_out_option : str = "python_betterproto2_out " if not reference else "python_out"
5050
5151 if pydantic_dataclasses :
5252 plugin_path = Path ("src/betterproto2_compiler/plugin/main.py" )
You can’t perform that action at this time.
0 commit comments