Base data classes¶
CogniteResource¶
-
class
cognite.client.data_classes._base.
CogniteResource
¶ -
dump
(camel_case: bool = False) → Dict[str, Any]¶ Dump the instance into a json serializable Python data type.
Parameters: camel_case (bool) – Use camelCase for attribute names. Defaults to False. Returns: A dictionary representation of the instance. Return type: Dict[str, Any]
-
to_pandas
(expand: Sequence[str] = ('metadata', ), ignore: List[str] = None, camel_case: bool = False) → pandas.DataFrame¶ Convert the instance into a pandas DataFrame.
Parameters: - expand (List[str]) – List of row keys to expand, only works if the value is a Dict. Will expand metadata by default.
- ignore (List[str]) – List of row keys to not include when converting to a data frame.
- camel_case (bool) – Convert column names to camel case (e.g. externalId instead of external_id)
Returns: The dataframe.
Return type: pandas.DataFrame
-
CogniteResourceList¶
-
class
cognite.client.data_classes._base.
CogniteResourceList
(resources: Collection[Any], cognite_client: CogniteClient = None)¶ -
dump
(camel_case: bool = False) → List[Dict[str, Any]]¶ Dump the instance into a json serializable Python data type.
Parameters: camel_case (bool) – Use camelCase for attribute names. Defaults to False. Returns: A list of dicts representing the instance. Return type: List[Dict[str, Any]]
-
extend
(other: Collection[Any]) → None¶ S.extend(iterable) – extend sequence by appending elements from the iterable
-
get
(id: Optional[int] = None, external_id: Optional[str] = None) → Optional[cognite.client.data_classes._base.CogniteResource]¶ Get an item from this list by id or exernal_id.
Parameters: - id (int) – The id of the item to get.
- external_id (str) – The external_id of the item to get.
Returns: The requested item
Return type: Optional[CogniteResource]
-
to_pandas
(camel_case: bool = False) → pandas.DataFrame¶ Convert the instance into a pandas DataFrame.
Returns: The dataframe. Return type: pandas.DataFrame
-
CogniteResponse¶
-
class
cognite.client.data_classes._base.
CogniteResponse
¶ -
dump
(camel_case: bool = False) → Dict[str, Any]¶ Dump the instance into a json serializable Python data type.
Parameters: camel_case (bool) – Use camelCase for attribute names. Defaults to False. Returns: A dictionary representation of the instance. Return type: Dict[str, Any]
-
CogniteFilter¶
-
class
cognite.client.data_classes._base.
CogniteFilter
¶ -
dump
(camel_case: bool = False) → Dict[str, Any]¶ Dump the instance into a json serializable Python data type.
Parameters: camel_case (bool) – Use camelCase for attribute names. Defaults to False. Returns: A dictionary representation of the instance. Return type: Dict[str, Any]
-
CogniteUpdate¶
-
class
cognite.client.data_classes._base.
CogniteUpdate
(id: Optional[int] = None, external_id: Optional[str] = None)¶ -
dump
(camel_case: bool = True) → Dict[str, Any]¶ Dump the instance into a json serializable Python data type.
Returns: A dictionary representation of the instance. Return type: Dict[str, Any]
-