Hello monday.com community!
We at Trix Solutions are excited to announce the beta release of Moncli v2! We have put a great deal of work into simplifying existing pain-points and providing some awesome new features that will simplify your development experience!
Firstly, we have largely redone how we handle column values. With v2, all column values are retrieved as their corresponding Python native type or class using only the value property. They can be set with the same data type or , in some cases, with a convertable data type like a simple string. Take the following code retrieving a date column as an example.
item = client.get_items(ids=, limit=1, get_column_values=True) date_value = item.column_values['Date'] print(date_value.value) # Returns datetime.datetime(2021, 11, 15, 0, 0) # Update value with simple string date_value.value = '2021-11-16' item.change_column_value(date_value)
Secondly, we have introduced the new monday.com Models and Types for Python. These new additions allow for developers to map their board schemas directly to a Python class.
Say you have a board that tracks work tasks with a people column (Assignees), a status column (Status), a date column (Due Date), and a number column (Total Hours). These columns may be mapped to a Python class as a MondayModel , retrieved from monday.com, and saved back to monday.com as shown below:
class WorkTask(MondayModel): assignees = PeopleType(title='Assignees') # column IDs can used instead with the id key-word argument status = StatusType(title='Status') due_date = DateType(title='Date') total_hours = NumberType(title='Total Hours') task = client.get_items(ids=, get_column_values=True, as_model=WorkTask, limit=1) task.status = 'Done' task.total_hours = 15 task.save() #Saves data only for column values that have been updated
Additional features include
- Retrieving an item’s subitems
- Removing an item’s files
- Enhancements to Item.change_column_value for using the column id or title with the raw value
- Fixes to MondayClient.create_board
- Proper error handling for 401 Unauthorized errors.
For more information about the newly added features and enhancements, please check out our wiki page.
For any additional inquiries regarding support or training, please feel free to reach out to email@example.com, and we would be happy to help! Any and all feedback is highly valued and appreciated!
Thank you and happy coding!