vlivepy.model.DataModel¶
-
class
vlivepy.model.
DataModel
(method: Callable, target_id: str, session: Optional[vlivepy.session.UserSession] = None, init_data: Optional[dict] = None)[source]¶ Bases:
object
This is the base object for other class objects. It sends request with method from each modules and caching response.
DataModels and its child objects are able to compare equality. Each objects are considered equal, if their
type
andtarget_id
is equal.Note
This is the base object for other object without independent usage.
- Parameters
method (
typing.Callable
) – function for loading data.target_id (
str
) – argument for method.session (
UserSession
, optional) – session for method, defaults to None.init_data (
dict
, optional) – set initial data instead of loading data, defaults to None.
-
session
¶ session for method
- Type
UserSession
-
property
raw
¶ Get full data as deep-copied dict.
- Return type
dict
-
property
target_id
¶ Get internal target id.
- Return type
str