Codync
무료 오픈소스 1:1 대안, Grok Bot과 Muse 대신
생성 코드 대신 디스크립터로 Protocol Buffers 메시지를 인코딩합니다
Decodes and encodes Protocol Buffers messages from descriptor sets rather than generated code. One message becomes a named list; many messages become a data frame built column by column. Uses a bundle
개발 도구C · RGitHub @pedrobtz온라인운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
프로젝트 폴더에서 /nomorevibe verify를 실행하면 소유권을 확인하고 소개를 직접 관리할 수 있습니다.
1분 만에 확인하기Decodes and encodes Protocol Buffers messages from descriptor sets rather than generated code. One message becomes a named list; many messages become a data frame built column by column. Uses a bundled copy of the upb runtime (<https://github.com/protocolbuffers/protobuf>), so no system protobuf library is required. Schemas are compiled into descriptor sets beforehand, with protoc or buf.
저장소 README에서 가져옴
README 전체를 불러오는 중입니다.
README 전문 보기 ↗Protocol Buffers is a binary format for structured data. gRPC APIs, Kafka topics, transit feeds, telemetry pipelines and machine-learning datasets all use it. Its bytes mean nothing without the schema that describes them, and reading them in R has meant installing the C++ protobuf library and handling each message as its own object.
zuproto reads and writes any protobuf message in R. It works from the compiled schema, and turns thousands of messages into one data frame.
protoc --descriptor_set_out or buf build writes
it, and it decodes and encodes every type in it.libprotobuf, Abseil or other R package to install or
run. protoc or buf is needed only once, to compile your schema.Timestamp is
POSIXct, Duration is difftime, and 64-bit integers can stay
exact.zuproto is not on CRAN yet. Once it is, install it with:
install.packages("zuproto")
Until then, install the development version from GitHub:
# install.packages("pak")
pak::pak("pedrobtz/zuproto")
library(zuproto)
A pool holds the message types zuproto knows. Every pool starts with protobuf’s well-known types:
pool <- proto_pool()
pool
#> <proto_pool: 11 files, 61 message types>
R values become messages and back. A Timestamp is a POSIXct, and a
Struct is a named list:
when <- as.POSIXct("2026-10-27 15:36:18", tz = "UTC")
bytes <- proto_encode(when, "google.protobuf.Timestamp", pool)
bytes
#> [1] 08 f2 89 83 d7 06
proto_decode(bytes, "google.protobuf.Timestamp", pool)
#> [1] "2026-10-27 15:36:18 UTC"
bytes <- proto_encode(
list(station = "Bern", platform = 7, delayed = TRUE),
"google.protobuf.Struct",
pool
)
str(proto_decode(bytes, "google.protobuf.Struct", pool))
#> List of 3
#> $ delayed : logi TRUE
#> $ platform: num 7
#> $ station : chr "Bern"
Protobuf’s JSON mapping goes both ways. A Timestamp is an RFC 3339
string in JSON:
json <- proto_to_json(
proto_encode(when, "google.protobuf.Timestamp", pool),
"google.protobuf.Timestamp",
pool
)
json
#> [1] "\"2026-10-27T15:36:18Z\""
proto_decode(
proto_from_json(json, "google.protobuf.Timestamp", pool),
"google.protobuf.Timestamp",
pool
)
#> [1] "2026-10-27 15:36:18 UTC"
Many messages become a data frame. A descriptor set is itself a protobuf
message, a FileDescriptorSet, so the one zuproto ships for the
well-known types can be read as a table. Each row is a .proto file,
with the number of message types it defines at the top level:
wkt <- system.file("descriptors", "wkt.binpb", package = "zuproto")
files <- proto_decode_df(
wkt,
"google.protobuf.FileDescriptorSet",
pool,
field = "file"
)
data.frame(
name = files$name,
messages = vapply(files$message_type, NROW, integer(1))
)
#> name messages
#> 1 google/protobuf/any.proto 1
#> 2 google/protobuf/source_context.proto 1
#> 3 google/protobuf/type.proto 5
#> 4 google/protobuf/api.proto 3
#> 5 google/protobuf/descriptor.proto 23
#> 6 google/protobuf/duration.proto 1
#> 7 google/protobuf/empty.proto 1
#> 8 google/protobuf/field_mask.proto 1
#> 9 google/protobuf/struct.proto 3
#> 10 google/protobuf/timestamp.proto 1
#> 11 google/protobuf/wrappers.proto 9
Your own schema goes in the same way. Compile it once with protoc or
buf, then load the descriptor set. Here it is with the live trip
updates for Switzerland’s public transport, in the GTFS Realtime format.
The code is not run here; the output is from 27 October 2026:
pool <- proto_pool("gtfs-realtime.binpb")
trips <- proto_decode_df(
"trip-updates.binpb",
"transit_realtime.FeedMessage",
pool,
field = "entity"
)
table(trips$trip_update$trip$schedule_relationship)[1:4]
#>
#> SCHEDULED ADDED UNSCHEDULED CANCELED
#> 15187 245 0 144
Every function that converts a message takes the value, the message type’s full name and the pool, in that order.
?proto_decode maps protobuf types to R types,
?proto_decode_df says how fields become columns, and
?zuproto-conditions lists the errors and warnings.zuproto bundles upb and utf8_range from
protobuf v36.2. Its CI
runs protobuf’s conformance test suite, with the tests zuproto is
expected to fail listed and explained, and the test fixtures come from
Python’s protobuf.
RProtoBuf binds the C++
protobuf library and handles each message as an object.
protolite serialises a
fixed set of schemas: R objects, GeoJSON and Mapbox vector tiles.