in content_api.py [0:0]
def text(self) -> str:
"""Returns part text as string.
Returns:
The text of the part.
Raises:
ValueError if part has no text.
"""
if not mime_types.is_text(self.mimetype) and not mime_types.is_json(
self.mimetype
):
raise ValueError('Part is not text.')
return self.part.text or ''