docarray.document.mixins.blob module#
- class docarray.document.mixins.blob.BlobDataMixin[source]#
Bases:
object
Provide helper functions for
Document
to handle binary data.- load_uri_to_blob(**kwargs)[source]#
Convert
uri
toblob
inplace. Internally it downloads from the URI and setblob
.- Parameters:
kwargs – keyword arguments to pass to :meth:_uri_to_blob such as timeout
- Return type:
T
- Returns:
itself after processed
- convert_blob_to_datauri(charset='utf-8', base64=False)[source]#
Convert
blob
to datauri
in place. Internally it first reads into blob and then converts it to data URI.- Parameters:
charset (
str
) – charset may be any character set registered with IANAbase64 (
bool
) – used to encode arbitrary octet sequences into a form that satisfies the rules of 7bit. Designed to be efficient for non-text 8 bit and binary data. Sometimes used for text data that frequently uses non-US-ASCII characters.
- Return type:
T
- Returns:
itself after processed