Converting a board to DataFrame works slowly
Closed this issue · 1 comments
Hello,
I'm trying to get a Monday board and save it to a DataFrame but it takes a few seconds per row. I was wondering if I'm using moncli wrong for this and would love your comments.
mdGroupsBoard = mondayClient.get_board(id=groupsBoardID) groupsDF = pd.DataFrame() for item in mdGroupsBoard.items: Hidden = item.get_column_value(id='check') Subitems = item.get_column_value(id='subitems0') Status = item.get_column_value(id='status') groupsDF = groupsDF.append( { 'Group ID':[item.id], 'Group name':[item.name], 'Rules':[Subitems.value], 'Hidden':[Hidden.checked], 'Status':[Status.label] }, ignore_index=True ))
Thanks!
Hello @omershk,
You could do the following to get just the column values that you would need using the get_boards method with the following return field values and arguments.
mdGroupsBoard = mondayClient.get_board( 'items.column_values.id', 'items.column_values.title', 'items.column_values.text', 'items.column_values.value', 'items.column_values.additional_info', ids=[groupsBoardID])[0]
With this request, you will get your requested board with all items and their column values. You can then loop through your items and map the column values to your dataframe.
You will need to download the new release for v1.0.10 using the pip install moncli --upgrade command.
Please let me know if you run into any further issues. I would also be very curious to see what you are doing with this. I have had my eye on this for some time, and any contributions or pointers to this project would be greatly appreciated!