I have created a group in my Enterprise portal and shared about 1500 images to this group. I have been trying to write a script to assign categories to each image based on the country code in the image name. According to the ArcGIS Python API, Group objects should have a 'categories' property, but when I attempt to access this via the following (generalized) example:
MyGroup = portal.groups.get('GroupIdNumber')
MyGroup.categories
I get an error stating: 'Group' object has no attribute 'categories'
It appears I should be able to get the CategorySchemaManager through this property and then use the assign_to_items function to complete the process.
I can access the group and its content just fine, but I cannot seem to find a way to access the categories property in order to assign items to the categories.
Is there another way that I can use to assign categories to each item shared with a group?
Thank you!
Good question,
I have the same challenge, I want to enumerate the sub-categories of a Group
and then list the layers within that groups' category.
THis code doesn't give me any object called "categories"
And running group.categories.schema[0]['categories'] seem to enumerate every category
What I need is a programmatical (.py) method to enumerate the Portal > Groups > My Organization's Groups > {select the group} > then select Content > and on the left, I see the categories with a number of layers in each.
HOW DO I GET THIS IN PYTHON!?
I found a solution!