mstrio.modeling.schema.attribute package

Submodules

mstrio.modeling.schema.attribute.attribute module

class mstrio.modeling.schema.attribute.attribute.Attribute(connection: Connection, id: str | None = None, name: str | None = None, show_expression_as: mstrio.modeling.expression.enums.ExpressionFormat | str = ExpressionFormat.TREE)

Bases: Entity, CopyMixin, MoveMixin, DeleteMixin, TranslationMixin

Python representation of MicroStrategy Attribute object.

id

attribute’s ID

name

attribute’s name

sub_type

string literal used to identify the type of a metadata object

description

attribute’s description

type

object type, ObjectTypes enum

subtype

object subtype, ObjectSubTypes enum

ext_type

object extended type, ExtendedType enum

ancestors

list of ancestor folders

date_created

creation time, DateTime object

date_modified

last modification time, DateTime object

destination_folder_id

a globally unique identifier used to distinguish between metadata objects within the same project

forms

the list of attribute forms

attribute_lookup_table

Information about an object referenced within the specification of another object. An object reference typically contains only enough fields to uniquely identify the referenced objects.

key_form

a key form of an attribute

displays

The collections of attribute displays and browse displays

sorts

the collections of attribute sorts and browse sorts of the attribute.

relationships

the list of relationships that one attribute has.

is_embedded

If true indicates that the target object of this reference is embedded within this object. Alternatively if this object is itself embedded, then it means that the target object is embedded in the same container as this object.

owner

User object that is the owner

acg

access rights (See EnumDSSXMLAccessRightFlags for possible values)

acl

object access control list

hidden

Specifies whether the object is hidden.

add_child(child: mstrio.modeling.schema.helpers.SchemaObjectReference | None = None, joint_child: list[mstrio.modeling.schema.helpers.SchemaObjectReference] | None = None, relationship_type: RelationshipType = RelationshipType.ONE_TO_MANY, table: mstrio.modeling.schema.helpers.SchemaObjectReference | None = None) None

Add a child to the attribute.

Parameters:
  • child – SchemaObjectReference of an attribute

  • joint_child – list of SchemaObjectReferences of an attributes

  • relationship_type – RelationshipType enum object, by default RelationshipType.ONE_TO_MANY

  • table – SchemaObjectReference of a lookup table, if not passed attribute lookup table is used

add_fact_expression(form_id: str, expression: FactExpression)

Add expression to the form. :param form_id: ID of the form to which the expression is to be added, :param expression: the expression that is to be added,

add_form(form: mstrio.modeling.schema.attribute.attribute_form.AttributeForm | None = None, name: str | None = None, expressions: list[mstrio.modeling.expression.fact_expression.FactExpression] | None = None, lookup_table: mstrio.modeling.schema.helpers.SchemaObjectReference | None = None, description: str | None = None, category: str | None = None, display_format: mstrio.modeling.schema.attribute.attribute_form.AttributeForm.DisplayFormat | None = None, data_type: mstrio.modeling.schema.helpers.DataType | None = None, alias: str | None = None, child_forms: list[mstrio.modeling.schema.helpers.FormReference] | None = None, geographical_role: mstrio.modeling.schema.attribute.attribute_form.AttributeForm.GeographicalRole | None = None, time_role: mstrio.modeling.schema.attribute.attribute_form.AttributeForm.TimeRole | None = None, is_form_group: bool = False, is_multilingual: bool = False)

Create new attribute form and add it to the attribute.forms list. The form can be added from completed AttributeForm objects provided in form parameter, or by filling other parameters.

Parameters:
  • form – complete AttibuteForm object that will be added to the Attribute

  • name – The name of the attribute form set by the attribute. Unlike category, which is the systemic name associated with each reusable form, this name is specific to the attribute using this form

  • expressions – Array with a member object for each separately defined expression currently in use by a fact. Often a fact expression takes the form of just a single column name, but more complex expressions are possible.

  • lookup_table – lookup table of the AttributeForm. It has to be a lookup table used in one of the expressions assigned to AttributeForm

  • description – description of the AttributeForm

  • category – The category of the attribute form. Unlike name, this field is independent of the attribute using this form. This field can only be set when creating a new form. Once a form is created, its category becomes non-mutable. If not provided (or set as None) when an attribute is being created, a custom category will be automatically generated.

  • display_format – display format of the AttributeForm

  • data_type – Representation in the object model for a data-type that could be used for a SQL column.

  • alias – alias of the AttributeForm

  • child_forms – only used if ‘is_form_group’ is set to true

  • geographical_role – identifies the type of geographical information this form represents

  • time_role – time role of the AttributeForm

  • is_form_group – A boolean field indicating whether this form is a form group (if true) or a simple form (if false).

  • is_multilingual – A boolean field indicating whether this field is multilingual. Any key form of the attribute is not allowed to be set as multilingual.

add_parent(parent: SchemaObjectReference, relationship_type: RelationshipType = RelationshipType.ONE_TO_MANY, table: mstrio.modeling.schema.helpers.SchemaObjectReference | None = None) None

Add a parent to the attribute.

Parameters:
  • parent – SchemaObjectReference of an attribute

  • relationship_type – RelationshipType enum object, by default RelationshipType.ONE_TO_MANY

  • table – SchemaObjectReference of a lookup table, if not passed attribute lookup table is used

alter(sub_type: str | None = None, name: str | None = None, is_embedded: bool | None = None, description: str | None = None, destination_folder_id: str | None = None, forms: list[mstrio.modeling.schema.attribute.attribute_form.AttributeForm] | None = None, attribute_lookup_table: mstrio.modeling.schema.helpers.SchemaObjectReference | None = None, key_form: mstrio.modeling.schema.helpers.FormReference | None = None, displays: mstrio.modeling.schema.helpers.AttributeDisplays | None = None, sorts: mstrio.modeling.schema.helpers.AttributeSorts | None = None, relationships: mstrio.modeling.schema.attribute.relationship.Relationship | None = None, hidden: bool | None = None, comments: str | None = None)

Alter attribute properties.

Parameters:
  • name – attribute’s name

  • description – attribute’s description

  • is_embedded – If true indicates that the target object of this reference is embedded within this object. Alternatively if this object is itself embedded, then it means that the target object is embedded in the same container as this object.

  • destination_folder_id – A globally unique identifier used to distinguish between metadata objects within the same project. It is possible for two metadata objects in different projects to have the same Object Id.

  • forms – attribute’s forms list

  • attribute_lookup_table – Information about an object referenced within the specification of another object. An object reference typically contains only enough fields to uniquely identify the referenced objects.

  • key_form – a key form of an attribute

  • displays – The collections of attribute displays and browse displays of the attribute.

  • sorts – The collections of attribute sorts and browse sorts of the attribute.

  • relationships – the list of relationships that one attribute has.

  • hidden – Specifies whether the attribute is hidden.

  • comments – long description of the attribute

alter_fact_expression(form_id: str, fact_expression_id: str, expression: Optional[Expression] = None, tables: list[mstrio.modeling.schema.helpers.SchemaObjectReference] | None = None)

Alter fact expression of the attribute form with given ID :param form_id: ID of the form that uses certain expression :param fact_expression_id: ID of the fact expression that is to be altered, :param expression: new expressions of the fact expression :param tables: new tables of the fact expression

alter_form(form_id: str, name: str | None = None, description: str | None = None, display_format: mstrio.modeling.schema.attribute.attribute_form.AttributeForm.DisplayFormat | None = None, data_type: mstrio.modeling.schema.helpers.DataType | None = None, expressions: list[mstrio.modeling.expression.fact_expression.FactExpression] | None = None, alias: str | None = None, lookup_table: mstrio.modeling.schema.helpers.SchemaObjectReference | None = None, child_forms: list[mstrio.modeling.schema.helpers.FormReference] | None = None, geographical_role: mstrio.modeling.schema.attribute.attribute_form.AttributeForm.GeographicalRole | None = None, time_role: mstrio.modeling.schema.attribute.attribute_form.AttributeForm.TimeRole | None = None, is_form_group: bool | None = None, is_multilingual: bool | None = None, comments: str | None = None)

Alter attribute form with a given form_id.

Parameters:
  • form_id – ID of the attribute form that will be altered

  • name – The name of the attribute form set by the attribute. Unlike category, which is the systemic name associated with each reusable form, this name is specific to the attribute using this form

  • description – description of the AttributeForm

  • display_format – display format of the AttributeForm

  • data_type – Representation in the object model for a data-type that could be used for a SQL column.

  • expressions – Array with a member object for each separately defined expression currently in use by a fact. Often a fact expression takes the form of just a single column name, but more complex expressions are possible.

  • alias – alias of the AttributeForm

  • lookup_table – lookup table of the AttributeForm. It has to be a lookup table used in one of the expressions assigned to AttributeForm

  • child_forms – only used if ‘is_form_group’ is set to true

  • geographical_role – identifies the type of geographical information this form represents

  • time_role – time role of the AttributeForm

  • is_form_group – A boolean field indicating whether this form is a form group (if true) or a simple form (if false).

  • is_multilingual – A boolean field indicating whether this field is multilingual. Any key form of the attribute is not allowed to be set as multilingual.

  • comments – long description of the AttributeForm

static check_if_referenced_forms_exist(error_msg: str, forms: list[mstrio.modeling.schema.attribute.attribute_form.AttributeForm], refs: list[mstrio.modeling.schema.helpers.FormReference])

Check if all references point to a form in forms.

classmethod create(connection: Connection, name: str, sub_type: mstrio.modeling.schema.helpers.ObjectSubType | str, destination_folder: mstrio.object_management.folder.Folder | str, forms: list[mstrio.modeling.schema.attribute.attribute_form.AttributeForm], key_form: FormReference, displays: AttributeDisplays, description: str | None = None, is_embedded: bool = False, attribute_lookup_table: mstrio.modeling.schema.helpers.SchemaObjectReference | None = None, sorts: mstrio.modeling.schema.helpers.AttributeSorts | None = None, show_expression_as: mstrio.modeling.expression.enums.ExpressionFormat | str = ExpressionFormat.TREE, hidden: bool | None = None) Attribute

Alter attribute properties.

Parameters:
  • connection – MicroStrategy connection object returned by connection.Connection()

  • name – attribute’s name

  • sub_type – attribute’s sub_type

  • destination_folder – A globally unique identifier used to distinguish between metadata objects within the same project. It is possible for two metadata objects in different projects to have the same Object ID.

  • forms – attribute’s forms list

  • key_form – a key form of an attribute

  • displays – The collections of attribute displays and browse displays of the attribute.

  • description – attribute’s description

  • is_embedded – If true indicates that the target object of this reference is embedded within this object. Alternatively if this object is itself embedded, then it means that the target object is embedded in the same container as this object.

  • attribute_lookup_table – Information about an object referenced within the specification of another object. An object reference typically contains only enough fields to uniquely identify the referenced objects.

  • sorts – The collections of attribute sorts and browse sorts of the attribute.

  • show_expression_as (ExpressionFormat, str) – specify how expressions should be presented Available values: - ExpressionFormat.TREE or tree (default) - ExpressionFormat.TOKENS or `tokens

  • hidden (bool, optional) – Specifies whether the object is hidden. Default value: False.

Returns:

Attribute class object.

get_fact_expression(expression_id: str, form_id: str = None, form_name: str = None) mstrio.modeling.expression.fact_expression.FactExpression | None

Retrieve a certain fact expression of a local instance of Attribute object.

Parameters:
  • form_id – ID of the attribute form. It have priority over name parameter

  • form_name – name of the attribute form

  • expression_id – ID of the fact expression

get_form(id: str = None, name: str = None) mstrio.modeling.schema.attribute.attribute_form.AttributeForm | None

Retrieve a certain attribute form of a local instance of Attribute object.

Parameters:
  • id – ID of the attribute form. It has priority over name parameter

  • name – name of the attribute form

list_relationship_candidates(already_used: bool = True, to_dictionary: bool = True) dict | list[mstrio.modeling.schema.helpers.SchemaObjectReference]

Lists potential relationship candidates for the Attribute.

Parameters:
  • already_used – whether to show Attributes References, which are already parents or children

  • to_dictionary – whether to return results as a dict or list

Returns:

Dictionary with table names as keys and list of SchemaObjectReferences of the attributes as values if to_dictionary set to True, list of SchemaObjectReference of attributes as list otherwise.

list_tables(expression: mstrio.modeling.expression.fact_expression.FactExpression | str | None = None) list[mstrio.modeling.schema.helpers.SchemaObjectReference]

List all tables in the given expression. If expression is not specified, list all tables for attribute.

Parameters:

expression – the expression for which to list tables

Returns:

List of tables in the given expression or all tables for attribute.

remove_child(child: mstrio.modeling.schema.helpers.SchemaObjectReference | None = None, joint_child: list[mstrio.modeling.schema.helpers.SchemaObjectReference] | None = None) None

Removes a child of the attribute.

Parameters:
  • child – SchemaObjectReference of an attribute to be removed from child relationship

  • joint_child – list of SchemaObjectReferences of an attributes to be removed from joint child relationship

remove_fact_expression(form_id: str, fact_expression_id: str, new_lookup_table: mstrio.modeling.schema.helpers.SchemaObjectReference | None = None)

Remove expression from the form. If the expressions left are not using lookup table assigned to the form, provide new lookup table for the form.

Parameters:
  • form_id – ID of the form from which the expression is to be removed,

  • expression_id – ID of the expression that is to be removed,

  • new_lookup_table – new lookup table of the form

remove_form(form_id: str, new_key_form: mstrio.modeling.schema.helpers.FormReference | None = None)

Remove attribute form with a given form_id. If this form was present in displays or sorts, it will be automatically removed from there.

Parameters:
  • form_id – ID of the form that should be removed

  • new_key_form – new value of the attribute’s key_form parameter. Mandatory if the form that is to be removed is the current key form, otherwise optional.

remove_parent(parent: SchemaObjectReference) None

Removes a parent of the attribute.

Parameters:

parent – SchemaObjectReference of an attribute to be removed from parent relationship

to_dict(camel_case: bool = True) dict

Converts an object to a dictionary excluding object’s private properties. When converting the object to a dictionary, the object’s attributes become the dictionary’s keys and are in camel case by default Attribute values stored as objects are automatically converted to non-/ primitive data structures.

Parameters:

camel_case (bool, optional) – Set to True if attribute names should be converted from snake case to camel case. Defaults to True.

Returns:

A dictionary representation of object’s attributes and values.

By default, the dictionary keys are in camel case.

Return type:

dict

static validate_displays(displays: AttributeDisplays, forms: list[mstrio.modeling.schema.attribute.attribute_form.AttributeForm]) AttributeDisplays
Validate whether the Attribute Displays are populated correctly and

only use references to forms present in the Attribute Forms of this particular attribute.

Parameters:
  • displays – AttributeDisplays of the Attribute

  • forms – list of AttributeForm objects of the Attribute

Returns:

Validated, non-empty and properly referencing Attribute Displays

static validate_key_form(key_form: FormReference, forms: list[mstrio.modeling.schema.attribute.attribute_form.AttributeForm], error_msg: str | None = None) FormReference
Validate whether the key form exists in the list of attribute forms

provided

Parameters:
  • key_form – a key form of an attribute to perform validation on

  • forms – the list of the attribute forms

  • error_msg (optional) – optional message to display instead of the standard one

Returns:

A validated key form.

static validate_sorts(sorts: AttributeSorts, forms: list[mstrio.modeling.schema.attribute.attribute_form.AttributeForm]) mstrio.modeling.schema.helpers.AttributeSorts | None
Validate whether the sorts use form references that aren’t present

in the provided forms

Parameters:
  • sorts – the collections of attribute sorts and browse sorts of the attribute

  • forms – list of AttributeForm objects of the Attribute

Returns:

Validated sorts or nothing if the provided sorts were empty.

mstrio.modeling.schema.attribute.attribute.list_attributes(connection: Connection, name: str | None = None, attribute_subtype: mstrio.types.ObjectSubTypes | None = None, to_dictionary: bool = False, limit: int | None = None, search_pattern: mstrio.object_management.search_enums.SearchPattern | int = SearchPattern.CONTAINS, project_id: str | None = None, project_name: str | None = None, show_expression_as: mstrio.modeling.expression.enums.ExpressionFormat | str = ExpressionFormat.TREE, **filters) list[mstrio.modeling.schema.attribute.attribute.Attribute] | list[dict]

Get list of Attribute objects or dicts with them. Optionally filter attributes by specifying ‘name’, ‘attribute_subtype’.

Optionally use to_dictionary to choose output format.

Wildcards available for ‘name’:

? - any character * - 0 or more of any characters e.g. name_begins = ?onny will return Sonny and Tonny

Specify either project_id or project_name. When project_id is provided (not None), project_name is omitted.

Note

When project_id is None and project_name is None, then its value is overwritten by project_id from connection object.

Parameters:
  • connection – MicroStrategy connection object returned by connection.Connection()

  • name (string, optional) – value the search pattern is set to, which will be applied to the names of attributes being searched

  • attribute_subtype (ObjectSubTypes) – one of attribute subtypes: attribute, attribute_abstract, attribute_recursive, attribute_role, attribute_transformation

  • to_dictionary (bool, optional) – If True returns dict, by default (False) returns Attribute objects

  • limit (integer, optional) – limit the number of elements returned. If None all object are returned.

  • project_id (str, optional) – Project ID

  • project_name (str, optional) – Project name

  • search_pattern (SearchPattern enum or int, optional) – pattern to search for, such as Begin With or Exactly. Possible values are available in ENUM mstrio.object_management.SearchPattern. Default value is CONTAINS (4).

  • show_expression_as (ExpressionFormat, str) –

    specify how expressions should be presented Available values:

    • ExpressionFormat.TREE or tree (default)

    • ExpressionFormat.TOKENS or `tokens

  • **filters

    Available filter parameters: id str: Attribute’s ID name str: Attribute’s name description str: Attribute’s description date_created str: format: 2001-01-02T20:48:05.000+0000 date_modified str: format: 2001-01-02T20:48:05.000+0000 version str: Attribute’s version owner dict: e.g. {‘id’: <user’s id>, ‘name’: <user’s name>},

    with one or both of the keys: id, name

    acg str | int: access control group subtype str: object’s subtype ext_type str: object’s extended type

Returns:

list with Attribute objects or list of dictionaries

mstrio.modeling.schema.attribute.attribute_form module

class mstrio.modeling.schema.attribute.attribute_form.AttributeForm(connection: Connection, id: str)

Bases: Entity, TranslationMixin

The Attribute Form Object

Parameters:
  • connection – a Connection object tied to the desired environment

  • id – Attribute Form ID. Note that Form ID is associated with the form category used. Multiple forms that use the same category will have the same ID. However, since no two forms within the same attribute can use the same category, no two forms will share an ID in the same attribute.

  • name – The name of the attribute form set by the attribute. Unlike category, which is the systemic name associated with each reusable form, this name is specific to the attribute using this form.

  • description – description of the AttributeForm

  • category – The category of the attribute form. Unlike name, this field is independent of the attribute using this form. This field can only be set when creating a new form. Once a form is created, its category becomes non-mutable. If not provided (or set as None) when an attribute is being created, a custom category will be automatically generated.

  • form_type – A read-only field indicating the type of this form. A custom form is created if its category is set to None.

  • display_format – display format of the AttributeForm

  • data_type – Representation in the object model for a data-type that could be used for a SQL column.

  • expressions – Array with a member object for each separately defined expression currently in use by a fact. Often a fact expression takes the form of just a single column name, but more complex expressions are possible.

  • alias – alias of the AttributeForm

  • lookup_table – lookup table of the AttributeForm. It has to be a lookup table used in one of the expressions assigned to AttributeForm

  • child_forms – only used if ‘is_form_group’ is set to true

  • geographical_role – identifies the type of geographical information this form represents

  • time_role – time role of the AttributeForm

  • is_form_group – A boolean field indicating whether this form is a form group (if true) or a simple form (if false).

  • is_multilingual – A boolean field indicating whether this field is multilingual. Any key form of the attribute is not allowed to be set as multilingual.

class DisplayFormat(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: AutoName

Enumeration constants used to specify display format of the attribute form.

BIG_DECIMAL = 'big_decimal'
DATE = 'date'
DATE_TIME = 'date_time'
EMAIL = 'email'
HTML_TAG = 'html_tag'
NUMBER = 'number'
PHONE_NUMBER = 'phone_number'
PICTURE = 'picture'
SYMBOL = 'symbol'
TEXT = 'text'
TIME = 'time'
URL = 'url'
class FormType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: AutoName

Enumeration constants used to specify a type of this form.

CUSTOM = 'custom'
SYSTEM = 'system'
class GeographicalRole(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: AutoName

Enumeration constants used to specify geographical role of the attribute form.

AREA_CODE = 'area_code'
CITY = 'city'
COUNTRY = 'country'
COUNTY = 'county'
GEOMETRY = 'geometry'
LATITUDE = 'latitude'
LOCATION = 'location'
LONGITUDE = 'longitude'
NONE = 'none'
OTHER = 'other'
STATE = 'state'
ZIP_CODE = 'zip_code'
class TimeRole(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: AutoName

Enumeration constants used to specify time role of the attribute form.

DATE = 'date'
DAY = 'day'
DAY_OF_MONTH = 'day_of_month'
DAY_OF_QUARTER = 'day_of_quarter'
DAY_OF_WEEK = 'day_of_week'
DAY_OF_YEAR = 'day_of_year'
HOUR = 'hour'
HOUR_OF_DAY = 'hour_of_day'
MINUTE = 'minute'
MINUTE_OF_DAY = 'minute_of_day'
MINUTE_OF_HOUR = 'minute_of_hour'
MONTH = 'month'
MONTH_OF_QUARTER = 'month_of_quarter'
MONTH_OF_YEAR = 'month_of_year'
NONE = 'none'
QUARTER = 'quarter'
QUARTER_OF_YEAR = 'quarter_of_year'
SEASONAL_END = 'seasonal_end'
SEASONAL_ROOT = 'seasonal_root'
SECOND = 'second'
SECOND_OF_DAY = 'second_of_day'
SECOND_OF_HOUR = 'second_of_hour'
SECOND_OF_MINUTE = 'second_of_minute'
TIME = 'time'
WEEK = 'week'
WEEK_OF_MONTH = 'week_of_month'
WEEK_OF_QUARTER = 'week_of_quarter'
WEEK_OF_YEAR = 'week_of_year'
YEAR = 'year'
YEAR_OF_DECADE = 'year_of_decade'
alter(comments: str | None = None)

Alter attribute properties.

Parameters:

comments – long description of the attribute

get_fact_expression(id: str) FactExpression

Get a fact expression of a local instance of AttributeForm object.

Parameters:

id – id of the fact expression

is_referenced_by(form_reference: FormReference) bool

Check if attribute form is referenced in form_reference.

list_properties(camel_case=True) dict

Lists all properties of attribute form.

local_alter(name: str | None = None, description: str | None = None, display_format: mstrio.modeling.schema.attribute.attribute_form.AttributeForm.DisplayFormat | None = None, data_type: mstrio.modeling.schema.helpers.DataType | None = None, expressions: list[mstrio.modeling.expression.fact_expression.FactExpression] | None = None, alias: str | None = None, lookup_table: mstrio.modeling.schema.helpers.SchemaObjectReference | None = None, child_forms: list[mstrio.modeling.schema.helpers.FormReference] | None = None, geographical_role: mstrio.modeling.schema.attribute.attribute_form.AttributeForm.GeographicalRole | None = None, time_role: mstrio.modeling.schema.attribute.attribute_form.AttributeForm.TimeRole | None = None, is_form_group: bool | None = None, is_multilingual: bool | None = None)

Make changes to a local copy of AttributeForm. In order to change an AttributeForm object on the server, use Attribute.alter_form() method of a corresponding Attribute object.

classmethod local_create(connection: Connection, name: str, description: str | None = None, category: str | None = None, display_format: mstrio.modeling.schema.attribute.attribute_form.AttributeForm.DisplayFormat | None = None, data_type: mstrio.modeling.schema.helpers.DataType | None = None, expressions: list[mstrio.modeling.expression.fact_expression.FactExpression] | None = None, alias: str | None = None, lookup_table: mstrio.modeling.schema.helpers.SchemaObjectReference | None = None, child_forms: list[mstrio.modeling.schema.helpers.FormReference] | None = None, geographical_role: mstrio.modeling.schema.attribute.attribute_form.AttributeForm.GeographicalRole | None = None, time_role: mstrio.modeling.schema.attribute.attribute_form.AttributeForm.TimeRole | None = None, is_form_group: bool = False, is_multilingual: bool = False) AttributeForm

Internal method that creates ONLY LOCAL AttributeForm object. In order to create an AttributeForm object on the server, use Attribute.add_form() method of a corresponding Attribute object.

to_dict(camel_case=True) dict

Converts an object to a dictionary excluding object’s private properties. When converting the object to a dictionary, the object’s attributes become the dictionary’s keys and are in camel case by default Attribute values stored as objects are automatically converted to non-/ primitive data structures.

Parameters:

camel_case (bool, optional) – Set to True if attribute names should be converted from snake case to camel case. Defaults to True.

Returns:

A dictionary representation of object’s attributes and values.

By default, the dictionary keys are in camel case.

Return type:

dict

verify_is_simple_form(method_name_if_error: str)

Verify whether the form is a simple form and not a group form

mstrio.modeling.schema.attribute.relationship module

class mstrio.modeling.schema.attribute.relationship.Relationship(relationship_type: RelationshipType, relationship_table: SchemaObjectReference, parent: SchemaObjectReference, child: mstrio.modeling.schema.helpers.SchemaObjectReference | None = None, joint_child: list[mstrio.modeling.schema.helpers.SchemaObjectReference] | None = None)

Bases: Dictable

Python representation of MicroStrategy Attributes Relationship object.

parent

parent in a relationship

child

child in a relationship

joint_child

list of joint children in a relationship

relationship_table

relationship table in a relationship

ralationship_type

type of relationship, one of: one_to_many, one_to_one, many_to_many

class RelationshipType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: AutoName

Enumeration constants used to specify type of the relationship

MANY_TO_MANY = 'many_to_many'
ONE_TO_MANY = 'one_to_many'
ONE_TO_ONE = 'one_to_one'
class mstrio.modeling.schema.attribute.relationship.RelationshipType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: AutoName

Enumeration constants used to specify type of the relationship

MANY_TO_MANY = 'many_to_many'
ONE_TO_MANY = 'one_to_many'
ONE_TO_ONE = 'one_to_one'

Module contents