Skip to main content

Validate CBOR documents using CDDL schema language

Project description

PyCDDL: A CDDL validation library for Python

CDDL is a schema language for the CBOR serialization format. pycddl allows you to validate CBOR documents match a particular CDDL schema, based on the Rust cddl library.

For example, here we use the cbor2 library to serialize a dictionary to CBOR, and then validate it:

from pycddl import Schema
import cbor2

uint_schema = Schema("""
    object = {
        xint: uint
    }
"""
)
uint_schema.validate_cbor(cbor2.dumps({"xint", -2}))

If validation fails, a pycddl.ValidationError is raised.

Release notes

0.2.1

  • Added PyPy wheels.

0.2.0

  • Schemas are now only parsed once (when the Schema() object is created), instead of every time validation happens, which should improve validation performance.
  • Updated to a newer version of underlying CDDL library, which should make CDDL parsing more compliant.
  • Added a repr() implementation to Schema for easier debugging.

0.1.11

  • Initial release.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pycddl-0.2.1.tar.gz (14.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pycddl-0.2.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

pycddl-0.2.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

pycddl-0.2.1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB view details)

Uploaded PyPymanylinux: glibc 2.17+ x86-64

pycddl-0.2.1-cp37-abi3-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.7+Windows x86-64

pycddl-0.2.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.7+manylinux: glibc 2.17+ x86-64

pycddl-0.2.1-cp37-abi3-macosx_10_15_x86_64.whl (1.2 MB view details)

Uploaded CPython 3.7+macOS 10.15+ x86-64

File details

Details for the file pycddl-0.2.1.tar.gz.

File metadata

  • Download URL: pycddl-0.2.1.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.13.6

File hashes

Hashes for pycddl-0.2.1.tar.gz
Algorithm Hash digest
SHA256 9eb2540ddac08e95356f82a914e781f1cb5700be7881fbd71dd57d1c4ab5b891
MD5 fb93ca588c24fcb7d262f4bd6a9d63ec
BLAKE2b-256 18c4ba234cd36547cfef373221fe37780fd041268ed3e84ffd5f900213196081

See more details on using hashes here.

File details

Details for the file pycddl-0.2.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pycddl-0.2.1-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5d6c0aaee4f6b802fd8b5e6b01a335c23c0267ed1f5f18256dbcef4b685baaba
MD5 9f4de017b381b0c34a6b9ad4cce11a79
BLAKE2b-256 7e33eeb7935b0a3aada9b71401c84a9031eb6969973f7d8e2b24aa184b158515

See more details on using hashes here.

File details

Details for the file pycddl-0.2.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pycddl-0.2.1-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bb3453c77305a3bd54813b4fb952a2599f5900f90150700377987fef6a0efc0f
MD5 d5694189551ac638cea836c2ddd1be77
BLAKE2b-256 3b24d85ea3b89afc30ef7e17b1800735339e3e04f9f5a9af5888746b6281468c

See more details on using hashes here.

File details

Details for the file pycddl-0.2.1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pycddl-0.2.1-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 718c2bb64e0c53e44d1d4db5878c8e02a7df0623b0593bc591df9b6afd18aedc
MD5 f6547cd7dd0be89c012df4613960bb3c
BLAKE2b-256 62228b7b57891ca8b78f1caa64ec803bf5a677a6157499042185ef27cfb973f8

See more details on using hashes here.

File details

Details for the file pycddl-0.2.1-cp37-abi3-win_amd64.whl.

File metadata

  • Download URL: pycddl-0.2.1-cp37-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.0 MB
  • Tags: CPython 3.7+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/0.13.6

File hashes

Hashes for pycddl-0.2.1-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 edd14ed18eb0653c50758440c65e5c388d50a116fb093325d7c9b9ea46c1498f
MD5 2df26bedf6edb3db0cbd0ade4874697d
BLAKE2b-256 d99b7e8a98b1b840d6f38c0fd84c9c3b74d17a276839c72344f2a4c2a1747a13

See more details on using hashes here.

File details

Details for the file pycddl-0.2.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pycddl-0.2.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ee03ad006c405c53db831e7bacc6204508515f93f7c0b7c2cdd1e80fdcf2d596
MD5 30e9da61364874308dfbe39c258ae10d
BLAKE2b-256 d804a2eddff448f68870fd127a54687e80f191d5977936036a7b01be7d61cc75

See more details on using hashes here.

File details

Details for the file pycddl-0.2.1-cp37-abi3-macosx_10_15_x86_64.whl.

File metadata

File hashes

Hashes for pycddl-0.2.1-cp37-abi3-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 6b9696e247d2b9dd37c844b71985fddc444181a4e3cd85788355d31d5ed5e8ec
MD5 16d8ed2033a78e414fd1130d098f0838
BLAKE2b-256 a10bf41f39d58c49a019ef23352e5ff15ed4bcb229779e5e6c6b78f7ab26227a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page