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 toSchema
for easier debugging.
0.1.11
- Initial release.
Project details
Release history Release notifications | RSS feed
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 hashes)
Built Distributions
Close
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 |
Close
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 |
Close
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 |
Close
Hashes for pycddl-0.2.1-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | edd14ed18eb0653c50758440c65e5c388d50a116fb093325d7c9b9ea46c1498f |
|
MD5 | 2df26bedf6edb3db0cbd0ade4874697d |
|
BLAKE2b-256 | d99b7e8a98b1b840d6f38c0fd84c9c3b74d17a276839c72344f2a4c2a1747a13 |
Close
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 |
Close
Hashes for pycddl-0.2.1-cp37-abi3-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6b9696e247d2b9dd37c844b71985fddc444181a4e3cd85788355d31d5ed5e8ec |
|
MD5 | 16d8ed2033a78e414fd1130d098f0838 |
|
BLAKE2b-256 | a10bf41f39d58c49a019ef23352e5ff15ed4bcb229779e5e6c6b78f7ab26227a |