A protoc plugin that generates Zig bindings over upb
Project description
protoc-gen-zig
A protoc plugin that generates Zig bindings for Protocol Buffers, backed by the
upb C runtime.
protoc-gen-zig is part of the upb-zig
project. protoc-gen-zig is the only Zig Protobuf implementation that passes the Protobuf conformance
tests.
Installation
Install the Protobuf compiler first.
pip install protoc-gen-zig
Usage
protoc --zig_out=./gen your_file.proto
This assumes protoc-gen-zig has been added to $PATH, otherwise provide the path to protoc-gen-zig.
protoc --plugin=protoc-gen-zig --zig_out=./gen your_file.proto
How it Works
The code generator is written in Python using Mako templates. It reads protoc's CodeGeneratorRequest and outputs Zig source files that wrap the upb C runtime. The actual encode/decode logic lives in upb, which is fully conformant * The generated Zig code is a thin typed facade over that runtime.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file protoc_gen_zig-0.0.1-py3-none-any.whl.
File metadata
- Download URL: protoc_gen_zig-0.0.1-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d79781a921da1acced4c6ca459b171c643405344a90139ec6fcf06f3e9c5953
|
|
| MD5 |
acd2a4f6afe770c2db3a2c093f6966a1
|
|
| BLAKE2b-256 |
5b6ca3f5bc0a6dca88e551675089dc3cef1a3219f33a0b3755de1646741e895c
|