MilanoteUnofficialApi.elements.element

 1from .meta import Meta
 2from .location import Location
 3
 4class Element:
 5    """
 6    A Milanote element.
 7    """
 8
 9    id: str
10    """ID of the element."""
11    element_type: str
12    """Type of the element."""
13    meta: Meta
14    """Metadata of the element."""
15    location: Location
16    """Location of the element."""
17
18    def __init__(self, data):
19        self.id = data["id"]
20        self.element_type = data["elementType"]
21        self.meta = Meta(data["meta"])
22        self.location = Location(data["location"])
23
24    def __repr__(self):
25        return f"Element(id='{self.id}', element_type='{self.element_type}', meta={self.meta}, location={self.location})"
class Element:
 5class Element:
 6    """
 7    A Milanote element.
 8    """
 9
10    id: str
11    """ID of the element."""
12    element_type: str
13    """Type of the element."""
14    meta: Meta
15    """Metadata of the element."""
16    location: Location
17    """Location of the element."""
18
19    def __init__(self, data):
20        self.id = data["id"]
21        self.element_type = data["elementType"]
22        self.meta = Meta(data["meta"])
23        self.location = Location(data["location"])
24
25    def __repr__(self):
26        return f"Element(id='{self.id}', element_type='{self.element_type}', meta={self.meta}, location={self.location})"

A Milanote element.

Element(data)
19    def __init__(self, data):
20        self.id = data["id"]
21        self.element_type = data["elementType"]
22        self.meta = Meta(data["meta"])
23        self.location = Location(data["location"])
id: str

ID of the element.

element_type: str

Type of the element.

Metadata of the element.

Location of the element.