jina.types.document.mixins.content module

class jina.types.document.mixins.content.ContentPropertyMixin[source]

Bases: object

Provide helper functions for Document to allow universal content property access.

property content: DocumentContentType

Return the content of the document. It checks whichever field among blob, text, buffer has value and return it.

See also

blob, buffer, text

Return type

DocumentContentType

Returns

the value of the content depending on :meth:`content_type

property content_type: str

Return the content type of the document, possible values: text, blob, buffer

Return type

str

Returns

the type of content of this Document

property content_hash: str

Get the document hash according to its content.

Return type

str

Returns

the unique hash code to represent this Document

dump_content_to_datauri()[source]

Convert content in uri inplace with best effort

Return type

~T

Returns

itself after processed

convert_content_to_uri(**kwargs)