API reference
Encoding
Decoding
Types
- cbor2.undefined
A singleton representing the CBOR “undefined” value.
Type aliases
- type SemanticDecoderCallback = Callable[[Any, bool], Any]
The common type of callbacks accepted in the
semantic_decodersdecoder option.
A two-phase decoder callback accepted in the
semantic_decodersdecoder option.
Type of the callback returned by a
ShareableDecoderInitializer
- type ObjectHook = Callable[[collections.abc.Mapping[Any, Any]], Any]
Type of the callback needed for the
object_hookdecoder option.
- type TagHook = Callable[[CBORTag], Any]
Type of the callback needed for the
tag_hookdecoder option.
- type EncoderHook = Callable[[CBOREncoder, Any], Any]
Type of the callback needed for the
defaultencoder option.