MilanoteUnofficialApi.elements.card
1from .element import Element 2from .location import Location 3from .meta import Meta 4 5 6class Card(Element): 7 """ 8 A Milanote card. 9 """ 10 11 id: str 12 """ID of the element.""" 13 element_type: str 14 """Type of the element.""" 15 meta: Meta 16 """Metadata of the element.""" 17 location: Location 18 """Location of the element.""" 19 text_content: str 20 """Text content of the card.""" 21 reactions: list 22 """Reactions of the card.""" 23 24 def __init__(self, data: dict): 25 super().__init__(data) 26 self.text_content = data["content"].get("textContent", None) 27 if data["content"]["textContent"] is not None: 28 self.text_content = "".join([block["text"] for block in data["content"]["textContent"]["blocks"]]) 29 self.reactions = data["content"].get("reactions", None) 30 31 def __repr__(self): 32 return f"Card(id='{self.id}', text_content='{self.text_content}')"
7class Card(Element): 8 """ 9 A Milanote card. 10 """ 11 12 id: str 13 """ID of the element.""" 14 element_type: str 15 """Type of the element.""" 16 meta: Meta 17 """Metadata of the element.""" 18 location: Location 19 """Location of the element.""" 20 text_content: str 21 """Text content of the card.""" 22 reactions: list 23 """Reactions of the card.""" 24 25 def __init__(self, data: dict): 26 super().__init__(data) 27 self.text_content = data["content"].get("textContent", None) 28 if data["content"]["textContent"] is not None: 29 self.text_content = "".join([block["text"] for block in data["content"]["textContent"]["blocks"]]) 30 self.reactions = data["content"].get("reactions", None) 31 32 def __repr__(self): 33 return f"Card(id='{self.id}', text_content='{self.text_content}')"
A Milanote card.
Card(data: dict)
25 def __init__(self, data: dict): 26 super().__init__(data) 27 self.text_content = data["content"].get("textContent", None) 28 if data["content"]["textContent"] is not None: 29 self.text_content = "".join([block["text"] for block in data["content"]["textContent"]["blocks"]]) 30 self.reactions = data["content"].get("reactions", None)