xbrl.Instance

An xbrl.Instance object represents an XBRL instance document.

class xbrl.Instance

Proper instances of this class will be created within RaptorXML only, instantiation from script code will throw a NotImplementedError exception.

Class methods

classmethod xbrl.Instance.create_from_buffer(type cls, buf, *, DTS dts=None, catalog=None, taxonomy_package=None, utr=None, **kargs)

Returns a tuple with an xbrl.Instance and xml.ErrorLog object. Constructs a new xbrl.Instance object after parsing the XML content in the given buffer. To validate the instance against a specific DTS, supply an xbrl.taxonomy.DTS object using the dts parameters. Optional user XML catalogs can be specified with the catalog argument. Optional taxonomy packages can be specified with the taxonomy_package argument. Optional Units Registry can be specified with the utr argument. Other validation options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlxbrlserver/rxcli_xbrl_valxbrl.htm for a list of available options. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.

classmethod xbrl.Instance.create_from_document(type cls, DocumentInformationItem xbrl, *, DTS dts=None, catalog=None, taxonomy_package=None, utr=None, **kargs)

Returns a tuple with an xbrl.Instance and xml.ErrorLog object. Constructs a new xbrl.Instance object after processing the XML document. To validate the instance against a specific DTS, supply an xbrl.taxonomy.DTS object using the dts parameters. Optional user XML catalogs can be specified with the catalog argument. Optional taxonomy packages can be specified with the taxonomy_package argument. Optional Units Registry can be specified with the utr argument. Other validation options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlxbrlserver/rxcli_xbrl_valxbrl.htm for a list of available options. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.

classmethod xbrl.Instance.create_from_element(type cls, ElementInformationItem xbrl, *, DTS dts=None, catalog=None, taxonomy_package=None, utr=None, **kargs)

Returns a tuple with an xbrl.Instance and xml.ErrorLog object. Constructs a new xbrl.Instance object after processing the XML fragment xbrl. To validate the instance against a specific DTS, supply an xbrl.taxonomy.DTS object using the dts parameters. Optional user XML catalogs can be specified with the catalog argument. Optional taxonomy packages can be specified with the taxonomy_package argument. Optional Units Registry can be specified with the utr argument. Other validation options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlxbrlserver/rxcli_xbrl_valxbrl.htm for a list of available options. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.

classmethod xbrl.Instance.create_from_string(type cls, text, Schema schema=None, catalog=None, DTD dtd=None)

Returns a tuple with an xml.Instance and xml.ErrorLog object. Constructs a new xml.Instance object after parsing the XML string in text and optionally validating it against the given xsd.Schema. Any errors or warnings reported during the validation are set on the returned xml.ErrorLog object. [DEPRECATED] This method has been deprecated, please use the new xml.Instance.create_from_buffer() class method instead.

classmethod xbrl.Instance.create_from_url(type cls, url, *, DTS dts=None, catalog=None, taxonomy_package=None, utr=None, **kargs)

Returns a tuple with an xbrl.Instance and xml.ErrorLog object. Constructs a new xbrl.Instance object after parsing the XML content retrieved from the given url. To validate the instance against a specific DTS, supply an xbrl.taxonomy.DTS object using the dts parameters. Optional user XML catalogs can be specified with the catalog argument. Optional taxonomy packages can be specified with the taxonomy_package argument. Optional Units Registry can be specified with the utr argument. Other validation options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlxbrlserver/rxcli_xbrl_valxbrl.htm for a list of available options. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.

classmethod xbrl.Instance.detect_dts_references(input, *, Catalog catalog=None)
classmethod xbrl.Instance.is_wellformed_buffer(type cls, buf, *, DTD dtd=None, catalog=None, **kargs)

Checks the buffer buf containing a XML document according to the XML 1.0 or XML 1.1 specification for wellformedness and returns an xml.ErrorLog object with the results. Optional user XML catalogs can be specified with the catalog argument. Other validation options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlxbrlserver/rxcli_wf_xml.htm for a list of available options. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.

classmethod xbrl.Instance.is_wellformed_url(type cls, url, *, DTD dtd=None, catalog=None, **kargs)

Checks the XML document at the given url according to the XML 1.0 or XML 1.1 specification for wellformedness and returns an xml.ErrorLog object with the results. Optional user XML catalogs can be specified with the catalog argument. Other validation options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlxbrlserver/rxcli_wf_xml.htm for a list of available options. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.

classmethod xbrl.Instance.validate_buffer(type cls, buf, *, DTS dts=None, catalog=None, taxonomy_package=None, utr=None, **kargs)

Validates the XBRL instance from the given buffer buf according to the XBRL 2.1, Dimensions 1.0, Formula 1.0 and Table Linkbase 1.0 specification and returns an xml.ErrorLog object with the results. To validate the instance against a specific DTS, supply an xbrl.taxonomy.DTS object using the dts parameters. Optional user XML catalogs can be specified with the catalog argument. Optional taxonomy packages can be specified with the taxonomy_package argument. Optional Units Registry can be specified with the utr argument. Other validation options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlxbrlserver/rxcli_xbrl_valxbrl.htm for a list of available options. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.

classmethod xbrl.Instance.validate_document(type cls, DocumentInformationItem xbrl, *, DTS dts=None, catalog=None, taxonomy_package=None, utr=None, **kargs)

Validates the XBRL instance from the given XML document according to the XBRL 2.1, Dimensions 1.0, Formula 1.0 and Table Linkbase 1.0 specification and returns an xml.ErrorLog object with the results. To validate the instance against a specific DTS, supply an xbrl.taxonomy.DTS object using the dts parameters. Optional user XML catalogs can be specified with the catalog argument. Optional taxonomy packages can be specified with the taxonomy_package argument. Optional Units Registry can be specified with the utr argument. Other validation options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlxbrlserver/rxcli_xbrl_valxbrl.htm for a list of available options. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.

classmethod xbrl.Instance.validate_element(type cls, ElementInformationItem xbrl, *, DTS dts=None, catalog=None, taxonomy_package=None, utr=None, **kargs)

Validates the XBRL instance from the given XML fragment xbrl according to the XBRL 2.1, Dimensions 1.0, Formula 1.0 and Table Linkbase 1.0 specification and returns an xml.ErrorLog object with the results. To validate the instance against a specific DTS, supply an xbrl.taxonomy.DTS object using the dts parameters. Optional user XML catalogs can be specified with the catalog argument. Optional taxonomy packages can be specified with the taxonomy_package argument. Optional Units Registry can be specified with the utr argument. Other validation options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlxbrlserver/rxcli_xbrl_valxbrl.htm for a list of available options. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.

classmethod xbrl.Instance.validate_url(type cls, url, *, DTS dts=None, catalog=None, taxonomy_package=None, utr=None, **kargs)

Validates the XBRL instance at the given url according to the XBRL 2.1, Dimensions 1.0, Formula 1.0 and Table Linkbase 1.0 specification and returns an xml.ErrorLog object with the results. To validate the instance against a specific DTS, supply an xbrl.taxonomy.DTS object using the dts parameters. Optional user XML catalogs can be specified with the catalog argument. Optional taxonomy packages can be specified with the taxonomy_package argument. Optional Units Registry can be specified with the utr argument. Other validation options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlxbrlserver/rxcli_xbrl_valxbrl.htm for a list of available options. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.

Attributes

xbrl.Instance.arcrole_refs

Returns an iterator of xbrl.taxonomy.ArcroleRef objects which represent the XBRL arcroleRefs present in this instance.

xbrl.Instance.child_facts

Returns an xbrl.FactSet object which represents all the XBRL root level facts in this instance (doesn’t include facts that are children of other tuples).

xbrl.Instance.child_items

Returns an xbrl.FactSet object which represents all the XBRL root level items in this instance (doesn’t include items that are children of other tuples).

xbrl.Instance.child_tuples

Returns an xbrl.FactSet object which represents all the XBRL root level tuples in this instance (doesn’t include tuples that are children of other tuples).

xbrl.Instance.contexts

Returns an iterator of xbrl.Context objects which represent the XBRL contexts present in this instance.

xbrl.Instance.dts

Returns an xbrl.taxonomy.DTS object which represents the XBRL DTS discovered from this instance as a starting point.

xbrl.Instance.facts

Returns an xbrl.FactSet object which represents all the XBRL facts in this instance including facts that are children of other tuples.

Returns an iterator of xbrl.taxonomy.ExtendedLink objects which represent the XBRL footnote links present in this instance.

xbrl.Instance.id

Returns the value of the ‘id’ attribute as a string, or None if the XBRL root element doesn’t have an ‘id’ attribute.

xbrl.Instance.linkbase_refs

Returns an iterator of xbrl.taxonomy.LinkbaseRef objects which represent the XBRL linkbaseRefs present in this instance.

xbrl.Instance.nil_facts

Returns an xbrl.FactSet object which represents all nil XBRL facts in this instance including facts that are children of other tuples.

xbrl.Instance.non_nil_facts

Returns an xbrl.FactSet object which represents all non-nil XBRL facts in this instance including facts that are children of other tuples.

xbrl.Instance.role_refs

Returns an iterator of xbrl.taxonomy.RoleRef objects which represent the XBRL roleRefs present in this instance.

xbrl.Instance.schema_refs

Returns an iterator of xbrl.taxonomy.SchemaRef objects which represent the XBRL schemaRefs present in this instance.

xbrl.Instance.units

Returns an iterator of xbrl.Unit objects which represent the XBRL units present in this instance.

Methods

xbrl.Instance.arcrole_ref(arcroleURI)

Returns an xbrl.taxonomy.ArcroleRef object which represents the XBRL arcroleRef with the given arcroleURI, or None if no XBRL arcroleRef was found.

xbrl.Instance.check_eba_dqc_rules()

Check the additional filing rules for EBA as specified in https://www.bankingsupervision.europa.eu/banking/approach/dataqualitychecks/html/index.en.html. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.

xbrl.Instance.check_eba_filing_rules_csv(json_meta_data_url)

Check the additional filing rules for EBA xBRL-CSV reports as specified in the EBA XBRL Filing Rules document. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.

xbrl.Instance.check_eba_filing_rules_xml()

Check the additional filing rules for EBA xBRL-XML reports as specified in the EBA XBRL Filing Rules document. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.

xbrl.Instance.check_eiopa_filing_rules()

Check the additional filing rules for EIOPA XBRL reports as specified in the EIOPA XBRL Filing Rules document. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.

xbrl.Instance.check_srb_filing_rules()

Check the additional filing rules for SRB XBRL reports as specified in the SRB XBRL Filing Rules document. Any errors and warnings reported during the validation can be accessed through the returned xml.ErrorLog object.

xbrl.Instance.context(id)

Returns an xbrl.Context object which represents the XBRL context with the given ‘id’, or None if no XBRL context was found.

xbrl.Instance.find_fact(xpointer)

Returns an xbrl.Fact object which represent the fact with the given ID or at the given XPointer location. Returns None if no appropriate fact can be found.

xbrl.Instance.footnote_base_set(linkrole, arcrole=None)

Returns an xbrl.taxonomy.BaseSet object which represents the base set of footnote arc for the given linkrole and arcrole URI. If arcrole was not specified, the default fact-footnote arcrole is used.

Returns a set with link role URIs for each footnoteLink extended link that contains arcs with the given arcrole. If arcrole was not specified, the default fact-footnote arcrole is used.

xbrl.Instance.footnote_network(linkrole, arcrole=None)

Returns an xbrl.taxonomy.RelationshipNetwork object which represents the network of relationships of footnote arcs for the given linkrole and arcrole URI. If arcrole was not specified, the default fact-footnote arcrole is used.

xbrl.Instance.generate_layout_model(**kargs)

Generates the layout model for all tables defined in the supporting DTS by table resolution and layout against this instance and returns an xbrl.table.layout.TableModel, xml.ErrorLog tuple. Formula parameters can be set using the ‘formula_parameters’ argument by supplying a dict with the user-supplied parameter values. Use the same JSON format as accepted by the –formula-parameters CLI option. The ordering of layout nodes generated by an aspect node can be specified with the ‘aspect_node_order’ parameter which can be either ‘lexical’ or ‘instance’. When ‘preserve_empty_aspect_nodes’ is set to True, a placeholder structural node will created when the aspect node expands to the empty set. When ‘preserve_empty_relationship_nodes’ is set to True, a placeholder structural node will created when the relationship node expands to the empty set. When ‘preserve_merged_rule_nodes’ is set to True, a distinct structural node will be always created even if that node should be merged. When ‘table_elimination’ is set to True, any unpopulated slices (table rows or colulmns) are eliminated from the table.

xbrl.Instance.is_fact_equal(Instance instance, *, aspect_model=altova_xbrlapi_cpp.k_nAspectModel_dimensional, ignore_ids=True, ignore_duplicates=True, force_collapse_whitespace=False, compare_effective_numeric_values=True, compare_nans_as_equal=True)

Compares this XBRL instance with the given instance and returns True if both contain the exactly the same facts. Both instances must reference the same DTS. The following parameters influence the nature of the comparison: The aspect_model argument chooses the aspect model used to determine the aspects of each fact for comparison. Possible values are xbrl.formula.DIMENSIONAL and xbrl.formula.NON_DIMENSIONAL. When ignore_ids is set to True, id attributes on fact elements are not included in the comparison. When ignore_duplicates is set to True, multiple facts with equal aspects and value are collapsed into a single fact. When force_collapse_whitespace is set to True, XML whitespace collapsing is applied to all string values ignoring the whitespace factet of the actual XSD type definition. When compare_effective_numeric_values is set to True, XBRL 2.1 rounding (honoring the decimals/precision attribute) is applied before comparing numeric values. In this case the decimals and precision attributes are not compared anymore. When compare_nans_as_equal is set to True, facts with numeric value NaN are allowed to be a successful match.

xbrl.Instance.process_assertions(**kargs)

Processes all validation assertions defined in the supporting DTS against this instance and returns an xbrl.formula.AssertionProcessingResult, xml.ErrorLog tuple. Formula parameters can be set using the ‘formula_parameters’ argument by supplying a dict with the user-supplied parameter values. Use the same JSON format as accepted by the –formula-parameters CLI option. Other assertion processing options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlxbrlserver/rxcli_xbrl_valxbrl.htm for a list of available options. Any errors and warnings reported during the assertion processing can be accessed through the returned xml.ErrorLog object.

xbrl.Instance.process_formulas(**kargs)

Processes all formulas defined in the supporting DTS against this instance and returns an xml.Instance, xml.ErrorLog tuple. The actual type of the returned instance can be an xbrl.Instance object if ‘validate_formula_output’ was set to True and the formula generated instance is XBRL 2.1 valid. Formula parameters can be set using the ‘formula_parameters’ argument by supplying a dict with the user-supplied parameter values. Use the same JSON format as accepted by the –formula-parameters CLI option. Other formula processing options can be specified using additional kargs. Please consult the RaptorXML CLI documentation http://manual.altova.com/RaptorXML/raptorxmlxbrlserver/rxcli_xbrl_valxbrl.htm for a list of available options. Any errors and warnings reported during the formula processing can be accessed through the returned xml.ErrorLog object.

xbrl.Instance.role_ref(roleURI)

Returns an xbrl.taxonomy.RoleRef object which represents the XBRL roleRef with the given roleURI, or None if no XBRL roleRef was found.

xbrl.Instance.unit(id)

Returns an xbrl.Unit object which represents the XBRL uinit with the given ‘id’, or None if no XBRL unit was found.

Special methods

__bool__, __eq__, __ge__, __gt__, __le__, __lt__, __ne__