wotpy.codecs.base

Class that represents the codec interface.

Classes

BaseCodec Base codec abstract class.
class wotpy.codecs.base.BaseCodec

Bases: object

Base codec abstract class. All codecs must implement this interface.

media_types

Property getter for the supported media types of this codec.

to_bytes(value)

Takes a Python object and encodes it to an UTF8 bytes string to be included in a response.

to_value(value)

Takes an encoded value from a request that may be an UTF8 bytes or unicode string and decodes it to a Python object.