cbor2.types

exception cbor2.types.CBORDecodeEOF

Raised when decoding unexpectedly reaches EOF.

exception cbor2.types.CBORDecodeError

Raised for exceptions occurring during CBOR decoding.

exception cbor2.types.CBORDecodeValueError

Raised when the CBOR stream being decoded contains an invalid value.

exception cbor2.types.CBOREncodeError

Raised for exceptions occurring during CBOR encoding.

exception cbor2.types.CBOREncodeTypeError

Raised when attempting to encode a type that cannot be serialized.

exception cbor2.types.CBOREncodeValueError

Raised when the CBOR encoder encounters an invalid value.

exception cbor2.types.CBORError

Base class for errors that occur during CBOR encoding or decoding.

class cbor2.types.CBORSimpleValue(value)

Represents a CBOR “simple value”.

Parameters

value (int) – the value (0-255)

class cbor2.types.CBORTag(tag, value)

Represents a CBOR semantic tag.

Parameters
  • tag (int) – tag number

  • value – encapsulated value (any object)

class cbor2.types.FrozenDict(*args, **kwargs)

A hashable, immutable mapping type.

The arguments to FrozenDict are processed just like those to dict.

cbor2.types.undefined = undefined

Represents the “undefined” value.