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 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.2.tar.gz
(15.6 kB
view hashes)
Built Distributions
Close
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 |
Close
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 |
Close
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 |
Close
Hashes for pycddl-0.2.2-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6022084464491e062e0487c8cb1b9c081021366de4cc4ffda0bea53dbeecff65 |
|
MD5 | cbe3a834e2fbb5eeeffa3957ad2001cb |
|
BLAKE2b-256 | 6a0011b46b27e0d7871943eafec910d31156b0f92e605390dcc103d8dd93b459 |
Close
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 |
Close
Hashes for pycddl-0.2.2-cp37-abi3-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f2fed0a26cbefa9dec0415a1f63ef2ece8659c59f44d11357fa98acadf6afd9 |
|
MD5 | a4d58a0b1abbc0d8e3275acff83d54e4 |
|
BLAKE2b-256 | d738595f997eeb8403c74eb089deb399061c608113c1d383fe4429b26b4c1bae |