Contacts API - Group Modification
I'm currently trying to implement a small script to explicitly set/change a single contact's group. I'm not sure how to use the API.
Reading through http://omz-software.com/pythonista/docs/ios/contacts.html, I find ways to get all groups or those specific to a user, but I do not find information on how to set or change a user's group.
Did anyone already successfully implement this functionality?
introspectionto the rescue...
import contacts print(dir(contacts.get_all_groups()[-1])) # dir(the last Group in Contacts)
Group has three methods
Thank you, this is exactly the pointer I need..
A quick follow-up question on groups: I try to move a locally created contact to a group that is supposed to reside on a CardDAV-server.
Is there any way to distinguish between the individual accounts the groups belong to? I ask, because I can iterate over my iCloud-stored groups, but the CardDAV-stored group seems to be missing.
I will try and find my way in reverse (find a user, that is stored in the CardDAV-group and inspect the attributes), but maybe there is already some advice on how to speed up my learning here...