Zero-copy C/C++
Uses packed structs that map directly to memory. No encoding or decoding step required.

Zero-copy C/C++
Uses packed structs that map directly to memory. No encoding or decoding step required.
Flexible framing
Multiple frame profiles for different scenarios, from zero-overhead trusted links to robust multi-node networks.
Nested messages & arrays
Unlike Mavlink, supports complex message structures with nested messages and variable-length packing for arrays.
Cross-platform
Generate code for embedded C, server Python, and frontend TypeScript from a single proto definition.
pip install struct-frameCreate a .proto file:
package example;
message Status { option msgid = 1; uint32 id = 1; float value = 2;}Generate code:
# Pythonpython -m struct_frame status.proto --build_py --py_path generated/
# Cpython -m struct_frame status.proto --build_c --c_path generated/
# Multiple languagespython -m struct_frame status.proto --build_c --build_py --build_ts#include "example.structframe.hpp"
// Create a messageExampleStatus msg;msg.id = 42;msg.value = 3.14f;
// No encoding needed - use directly as bytesuint8_t* data = (uint8_t*)&msg;size_t size = sizeof(ExampleStatus);from struct_frame.generated.example import ExampleStatus
# Create a messagemsg = ExampleStatus(id=42, value=3.14)
# Serialize to bytesdata = msg.pack()import { ExampleStatus } from './example.structframe';
// Create a messageconst msg = new ExampleStatus();msg.id = 42;msg.value = 3.14;
// Get binary dataconst data = msg.data();#include "example.structframe.h"
// Create a messageExampleStatus msg = { .id = 42, .value = 3.14f };
// Use directly as bytesuint8_t* data = (uint8_t*)&msg;size_t size = sizeof(ExampleStatus);