--- id: zcbor version: "0.9.1" license: Apache license_treatment: permissive maintenance: active --- # zcbor — Code generation and data validation using CDDL schemas License: permissive · Maintenance: active · Downloads: 383.1K/mo ## What it is and what it does zcbor is a CDDL schema processor that works in two modes: as a validator for YAML, JSON, and CBOR data, and as a code generator that produces C implementations for encoding and decoding CBOR according to a schema. The package includes a C library (also used standalone in Zephyr RTOS) that handles the low-level CBOR operations; when you generate C code, zcbor either references this library via CMake or copies its sources to your project. The tool targets developers working with CBOR serialization who need either runtime validation in Python or embedded C implementations. CDDL (Concise Data Definition Language, RFC 8610) provides a powerful schema syntax for defining complex binary data structures, making zcbor useful for IoT, embedded systems, and any project where CBOR is the wire format. Use it for: - Validate incoming CBOR messages against a schema before processing in a Python service. - Generate C code for CBOR encoding/decoding in embedded or IoT firmware projects. - Convert between YAML/JSON and CBOR formats with schema-enforced validation. - Define and validate complex binary protocols using CDDL schemas. - Integrate CBOR serialization into Zephyr RTOS or other embedded systems via the C library. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. zcbor validates and converts YAML/JSON/CBOR data against CDDL schemas, and generates C code for encoding/decoding CBOR data with schema validation. Yes. zcbor fills a specific niche—CDDL-based CBOR validation and C code generation—with low install friction, active maintenance, no known vulnerabilities, and a permissive license. Install it if you need schema-driven CBOR handling in Python or C; skip it if you work exclusively with JSON or don't require CDDL's advanced schema features. ## Install pip install zcbor uv add zcbor poetry add zcbor ## Installing zcbor Before you install: Low friction install as a pure Python wheel. Actively maintained with recent commits and a stable release cadence; last release was 666 days ago with active repository status. License in practice: Apache permissive license allows commercial and private use with minimal restrictions, suitable for most projects including those generating proprietary C code. Quickstart: pip install zcbor import zcbor # Validate YAML/JSON/CBOR against a CDDL schema zcbor.validate(data, schema_file) # Or generate C code: zcbor code-gen schema.cddl --output-c Requires Python >= 3.8; generated C code depends on the bundled C library included in the package. Verify before relying: - Whether the bundled C library requires compilation or system dependencies on target platforms - Performance characteristics when validating large CBOR datasets - Completeness of CDDL RFC 8610 feature coverage ## Package facts - License: Apache (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 383.1K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags CBOR schema validation, CDDL code generator, CBOR encoder decoder, JSON YAML CBOR conversion, C code generation CBOR, schema-based data validation, CBOR C library, cbor-serialization, code-generation, embedded-systems [View on SkillFed](https://skillfed.io/packages/zcbor) · [View on PyPI](https://pypi.org/project/zcbor/)