The dip.io.codecs.unicode module implements support for Unicode encoders and decoders used with streaming storage.
Base class: Interface
The IUnicodeDecoder interface defines the interface to be implemented by models being decoded by the UnicodeCodec codec.
Set the model data from an Python v3 str object or a Python v2 unicode object.
Parameters: |
|
---|---|
Returns: | the decoded model. This may be the original model populated from the storage location, or it may be a different model (of an appropriate type) created from the storage location. |
Base class: Interface
The IUnicodeEncoder interface defines the interface to be implemented by models being encoded by the UnicodeCodec codec.
Return the model data encoded as a Python v3 str object or a Python v2 unicode object.
Parameter: | model – is the model. |
---|---|
Returns: | the encoded model data. |
Base class: Model
The UnicodeCodec class implements a codec that decodes and encodes models as Unicode. The codec does not set the format attribute. This should be defined in a sub-class or passed as an argument when the codec is created.
A model is decoded from a byte stream.
Parameters: |
|
---|---|
Returns: | the decoded model. This may be the original model populated from the storage location, or it may be a different model (of an appropriate type) created from the storage location. |
A model is encoded as a byte stream.
Parameters: |
|
---|---|
Returns: | a generator that will return sections of the encoded byte stream. |