Skip to content

Commit

Permalink
add team and folder filters in get_charts
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmarcos98 authored Feb 26, 2022
1 parent 8ecfefd commit c684aac
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions datawrapper/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,8 @@ def get_charts(
order: str = "DESC",
order_by: str = "createdAt",
limit: int = 25,
folder_id: str = "",
team_id: str = "",
) -> Union[None, List[Any]]:
"""Retrieves a list of charts by User
Expand All @@ -627,6 +629,10 @@ def get_charts(
Attribute to order by. One of createdAt, email, id, or name, by default "createdAt"
limit : int, optional
Maximum items to fetch, by default 25
folder_id : str, optional
ID of folder in Datawrapper.de where to list charts, by default ""
team_id : str, optional
ID of the team where to list charts. The authenticated user must have access to this team, by default ""
Returns
-------
Expand All @@ -650,6 +656,10 @@ def get_charts(
_query["orderBy"] = order_by
if limit:
_query["limit"] = str(limit)
if folder_id:
_data["folderId"] = folder_id
if team_id:
_data["teamId"] = team_id

get_charts_response = r.get(url=_url, headers=_header, params=_query)

Expand Down

0 comments on commit c684aac

Please sign in to comment.