Data & Storage ยท zero-dependency ยท MIT

larzcbor

CBOR encode/decode (RFC 8949).

A CBOR encoder/decoder verified against the RFC 8949 test vectors, with canonical encoding for deterministic output. The standards-based binary format for interop and COSE.

larzscript pkg install cbor
View on GitHub →Learn the stack

What you get

Try it

import "cbor" as cbor
let bytes_ = cbor.encode({"a": 1, "b": [1, 2, 3]})
print(len(bytes_))
print(cbor.decode(bytes_))
Output
10
{a: 1, b: [1, 2, 3]}

Why it's in the Larz Stack

larzcbor is a real Larzscript package (larzscript pkg install cbor) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.