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.2

  • Updated to cddl 0.9.1.

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.2.tar.gz (15.6 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.2-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.2-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.2-pp37-pypy37_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.2-cp37-abi3-win_amd64.whl (1.0 MB view details)

Uploaded CPython 3.7+Windows x86-64

pycddl-0.2.2-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.2-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.2.tar.gz.

File metadata

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

File hashes

Hashes for pycddl-0.2.2.tar.gz
Algorithm Hash digest
SHA256 a4ac4f2a0f6afe7cb8bf2bcab3d42f99c695698429a10cb7e2b25111c6746976
MD5 064752b898f8e2351a50f842e2d4dd64
BLAKE2b-256 a88ebeaebf547f7e13ca32c866b2fad7b808ef3d016f7829b1b1db1749820467

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycddl-0.2.2-pp39-pypy39_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 21ccdace7c7128fadd0bcb525f365c5846c5ca680a58898f09a1f81f17d02bab
MD5 f0e2c9db3eb1829342d5f851c3efc657
BLAKE2b-256 2e79d5ca83c3399fbecafd9c0cf49ecf078ecd891c3901073823d628588dc841

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycddl-0.2.2-pp38-pypy38_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f762db2fc6bf995856abbf26f1190f126a0fb7b915845797be14c8e37672717a
MD5 5904fbe651261cc7f802a7d99271ae15
BLAKE2b-256 d615cfe0d14ce7ca00a075a76c0a7668a7995b6004bc838f0f4926f8cac669ad

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycddl-0.2.2-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 670a4e83bede853586941cc441dbe3070608f70ec51bcda9412fc9fa1b0d3dbf
MD5 9e51e3aeedcf72e2a62924466a7c1d90
BLAKE2b-256 a1bcb91c2695e0cc086319ef6d557dbebc4405aadff0cda900ad47dfa9a6e2e0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pycddl-0.2.2-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.7

File hashes

Hashes for pycddl-0.2.2-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 6022084464491e062e0487c8cb1b9c081021366de4cc4ffda0bea53dbeecff65
MD5 cbe3a834e2fbb5eeeffa3957ad2001cb
BLAKE2b-256 6a0011b46b27e0d7871943eafec910d31156b0f92e605390dcc103d8dd93b459

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycddl-0.2.2-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 188531008432d5f109d5e0d646ff8fe05e7be2229dd5173f08275f68c29603dc
MD5 09db265e593a59623e495771eea8e71b
BLAKE2b-256 f88ba94bc6ea724596244a9d0fd726cfddd10cfc9577a53deadba6961462660f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for pycddl-0.2.2-cp37-abi3-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 6f2fed0a26cbefa9dec0415a1f63ef2ece8659c59f44d11357fa98acadf6afd9
MD5 a4d58a0b1abbc0d8e3275acff83d54e4
BLAKE2b-256 d738595f997eeb8403c74eb089deb399061c608113c1d383fe4429b26b4c1bae

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