protobuf_serialization
Protobuf implementation compatible with the nim-serialization framework.
Summary
| Latest Version | 0.6.2 |
|---|---|
| License | MIT |
| CI Status | Failing |
| Downloads | 0 |
| Last Indexed | 2026-09-01 07:18 |
Tags
Authors
- Status
Installation
nimble install protobuf_serialization
choosenim install protobuf_serialization
git clone https://github.com/status-im/nim-protobuf-serialization
OS Compatibility
| Platform | Linux | macOS | Windows | FreeBSD | OpenBSD | NetBSD | Android | iOS | WASM | Embedded |
|---|---|---|---|---|---|---|---|---|---|---|
| protobuf_serialization | ✓ | ✓ | ✓ | - | - | - | - | - | - | - |
Source
| Repository | https://github.com/status-im/nim-protobuf-serialization |
|---|---|
| Homepage | https://github.com/status-im/nim-protobuf-serialization |
| Registry Source | nimble_official |
README
nim-protobuf-serialization
Protobuf implementation compatible with the nim-serialization framework.
Documentation
Installation
Add to your .nimble file:
requires "protobuf_serialization"
Or install directly:
nimble install protobuf_serialization
Basic Usage
import protobuf_serialization
# Define a protobuf message
type
Person {.proto3.} = object
name {.fieldNumber: 1.}: string
age {.fieldNumber: 2, pint.}: int32
email {.fieldNumber: 3.}: string
# Encode and decode
let person = Person(name: "Alice", age: 30, email: "alice@example.com")
let encoded = Protobuf.encode(person)
let decoded = Protobuf.decode(encoded, Person)
assert decoded == person
Both Protobuf 2 and Protobuf 3 are supported. You can also import .proto files directly at compile-time using import_proto3.
License
Licensed and distributed under either of
- MIT license: LICENSE-MIT or http://opensource.org/licenses/MIT
or
- Apache License, Version 2.0, (LICENSE-APACHEv2 or http://www.apache.org/licenses/LICENSE-2.0)
at your option. These files may not be copied, modified, or distributed except according to those terms.