@@ -129,6 +129,7 @@ def create_chart(
129
129
chart_type : str = "d3-bars-stacked" ,
130
130
data : Union [pd .DataFrame , None ] = None ,
131
131
folder_id : str = "" ,
132
+ organization_id : str = "" ,
132
133
metadata : Optional [Dict [Any , Any ]] = None ,
133
134
) -> Union [Dict [Any , Any ], None , Any ]:
134
135
"""Creates a new Datawrapper chart, table or map.
@@ -147,6 +148,8 @@ def create_chart(
147
148
A pandas DataFrame containing the data to be added, by default None
148
149
folder_id : str, optional
149
150
ID of folder in Datawrapper.de for the chart, table or map to be created in, by default ""
151
+ organization_id : str, optional
152
+ ID of the team where the chart should be created. The authenticated user must have access to this team.
150
153
metadata: dict, optional
151
154
A Python dictionary of properties to add.
152
155
@@ -163,6 +166,8 @@ def create_chart(
163
166
164
167
if folder_id :
165
168
_data ["folderId" ] = folder_id
169
+ if organization_id :
170
+ _data ["organizationId" ] = organization_id
166
171
if metadata :
167
172
_data ["metadata" ] = metadata # type: ignore
168
173
@@ -636,8 +641,9 @@ def get_charts(
636
641
search : str = "" ,
637
642
order : str = "DESC" ,
638
643
order_by : str = "createdAt" ,
639
- folder_id : str = "" ,
640
644
limit : int = 25 ,
645
+ folder_id : str = "" ,
646
+ team_id : str = "" ,
641
647
) -> Union [None , List [Any ]]:
642
648
"""Retrieves a list of charts by User
643
649
@@ -653,10 +659,12 @@ def get_charts(
653
659
Result order (ascending or descending), by default "DESC"
654
660
order_by : str, optional
655
661
Attribute to order by. One of createdAt, email, id, or name, by default "createdAt"
656
- folder_id: str, optional
657
- ID of the folder to search charts in, by default ""
658
662
limit : int, optional
659
663
Maximum items to fetch, by default 25
664
+ folder_id : str, optional
665
+ ID of folder in Datawrapper.de where to list charts, by default ""
666
+ team_id : str, optional
667
+ ID of the team where to list charts. The authenticated user must have access to this team, by default ""
660
668
661
669
Returns
662
670
-------
@@ -678,10 +686,12 @@ def get_charts(
678
686
_query ["order" ] = order
679
687
if order_by :
680
688
_query ["orderBy" ] = order_by
681
- if folder_id :
682
- _query ["folderId" ] = folder_id
683
689
if limit :
684
690
_query ["limit" ] = str (limit )
691
+ if folder_id :
692
+ _query ["folderId" ] = folder_id
693
+ if team_id :
694
+ _query ["teamId" ] = team_id
685
695
686
696
get_charts_response = r .get (url = _url , headers = _header , params = _query )
687
697
0 commit comments