Back to directory

zcbor

A low-footprint CBOR library for microcontrollers, paired with a Python schema tool that validates YAML, JSON, or CBOR data and can generate C code for encoding and decoding it.

zcbor

zcbor is a low-footprint CBOR (Concise Binary Object Representation) library written in C, compatible with C++, tailored for use on microcontrollers, and usable on its own independent of its companion Python tooling. Its schema language is CDDL (Concise Data Definition Language, an IETF standard), which lets you describe detailed, advanced schemas for validating and converting data.

The Python script and module can validate a YAML, JSON, or CBOR file against a CDDL schema, convert between those formats, for example turning a validated YAML file into CBOR for transmission, decode and validate incoming CBOR data into human-readable YAML or JSON, and create a read-only representation of validated data through named tuples derived from the schema's field names; it shares its internal representation with other common Python YAML, JSON, and CBOR libraries. The code-generation part of the tool produces C code from the schema that performs CBOR encoding and decoding using the C library while validating data against every rule in the schema, intended for optimized or constrained environments. The project ships samples showing both the standalone C library and the generated-code approach, and its tests run under Zephyr.

More in Libraries

See all 292
  • OpenDecision

    deepanwadhwa.github.io

    An open-source Python package that answers typed questions about application state or documents using a local natural-language-inference model, returning structured choice, score, yes/no or evidence-relation values instead of free text.

  • TradeCanvas

    bonguynvan.github.io

    A zero-dependency canvas charting engine for building TradingView-style trading charts in JavaScript, with 66 technical indicators, 24 drawing tools, 17 chart types, and real-time streaming.

  • 3d retro graphics

    3d-retro.com

    A free, CC0-licensed library of copy-paste retro 3D and demoscene graphics effects, such as plasma, raytracing, and voxel terrain, runnable as WebGL 1 or plain 2D canvas.