MilanoteUnofficialApi.elements.file
1from .element import Element 2from .meta import Meta 3from .location import Location 4 5 6class File(Element): 7 """ 8 A Milanote file element. 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 file_name: str 20 """Name of the file.""" 21 file_ext: str 22 """Extension of the file.""" 23 url: str 24 """URL of the file.""" 25 26 def __init__(self, data: dict): 27 super().__init__(data) 28 self.file_name = data['content']['file']['filename'] 29 self.file_ext = data['content']['file']['ext'] 30 self.url = data['content']['file']['url'] 31 32 def __repr__(self): 33 return f"File(id='{self.id}', file_name='{self.file_name}')"
7class File(Element): 8 """ 9 A Milanote file element. 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 file_name: str 21 """Name of the file.""" 22 file_ext: str 23 """Extension of the file.""" 24 url: str 25 """URL of the file.""" 26 27 def __init__(self, data: dict): 28 super().__init__(data) 29 self.file_name = data['content']['file']['filename'] 30 self.file_ext = data['content']['file']['ext'] 31 self.url = data['content']['file']['url'] 32 33 def __repr__(self): 34 return f"File(id='{self.id}', file_name='{self.file_name}')"
A Milanote file element.