skipcheck

TM1 client · Docs · Dimensions and hierarchies

AttributeService

from skipcheck_tm1.services import AttributeService

Attribute definitions: which attributes a kind of object has, and their types, for each AttributeSet. Creating one adds it to every object of that kind; the values are cells of the matching }…Attributes control cube.

Add an attribute to every element of a hierarchy:

# A text attribute on every element of the Region hierarchy
manager = AttributeDefinitionPatch.builder().name("Manager").type(AttributeType.STRING).build()
return tm1.attributes.create(AttributeSet.elements("Region", "Region"), manager)

List the attributes a kind of object has, here cubes:

# The attributes that every cube has
attributes = tm1.attributes.list(AttributeSet.cubes(), ODataQuery.none().select(AttributeDefinition.NAME))
return [attribute.name for attribute in attributes if attribute.name is not None]

The asyncio flavor, skipcheck_tm1.aio, has the same methods to await, on AsyncAttributeService.

Members

listGET the set's attributes.
getGET one attribute of the set.
createAdds an attribute to every object of the set's kind.
deleteRemoves an attribute, with its values, from every object of the set's kind.

list

list(set: AttributeSet, query: ODataQuery | None = None, **options: Any) -> list[AttributeDefinition]

GET the set's attributes.

get

get(set: AttributeSet, name: str, query: ODataQuery | None = None, **options: Any) -> AttributeDefinition

GET one attribute of the set.

create

create(set: AttributeSet, attribute: Any) -> AttributeDefinition

POST: adds an attribute to every object of the set's kind.

delete

delete(set: AttributeSet, name: str) -> None

DELETE: removes an attribute, with its values, from every object of the set's kind.