File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -336,6 +336,31 @@ def chart_properties(
336336 )
337337 return None
338338
339+ def chart_data (self , chart_id : str ):
340+ """Retrieve the data stored for a specific chart, table or map, which is typically CSV.
341+
342+ Parameters
343+ ----------
344+ chart_id : str
345+ ID of chart, table, or map.
346+
347+ Returns
348+ -------
349+ dict
350+ A dictionary containing the information of the chart, table, or map.
351+ """
352+ # Request the data endpoint
353+ response = r .get (
354+ url = self ._CHARTS_URL + f"/{ chart_id } /data" ,
355+ headers = self ._auth_header ,
356+ )
357+
358+ # Check if the request was successful
359+ assert response .ok , "Make sure you have the right id and authorization credentials (access_token)."
360+
361+ # Return the data
362+ return response .json ()
363+
339364 def update_metadata (
340365 self , chart_id : str , properties : Dict [Any , Any ]
341366 ) -> Union [Any , None ]:
You can’t perform that action at this time.
0 commit comments