This module define functions to serialize and deserialize objects to and from CBOR format. The serialization and deserialization of objects is performed using a wrapped version of the awesome and lighting fast libcbor
ValueErrorwhen data contains bad or unsupported CBOR.
Returns a bytes object containing the CBOR representation of obj. If a Python object is not serializable to CBOR, it is serialized to
Undefined. The function always produces definite major types (bytestrings, string, arrays and maps). To generate CBOR specific structures such as tags and undefined values, pass as argument instances of the
RuntimeErrorwhen obj can’t be serialized.
Create a Tag instance. Tag instances have two attributes,
valuethat can be manually changed if needed.
tagmust be an integer while
valuecan be any CBOR serializable python object. An instance of this class is returned during deserialization if a tag is found.