arelle.ModelManager

See COPYRIGHT.md for copyright information.

Module Contents

Classes

ModelManager

ModelManager provides an interface between modelXbrl’s and the controller. Model manager is a singleton object, one is created in initialization of a controller.

Functions

API

arelle.ModelManager.initialize(cntlr: arelle.Cntlr.Cntlr) ModelManager
class arelle.ModelManager.ModelManager(cntlr: arelle.Cntlr.Cntlr)

ModelManager provides an interface between modelXbrl’s and the controller. Model manager is a singleton object, one is created in initialization of a controller.

The ModelManager coordinates ModelXbrl instances for the Controller, and is the interface to utility functions (such as the Python web cache), and application specific formalisms (such as the SEC restrictions on referencable base taxonomies).

.. attribute:: validateDisclosureSystem

True if disclosure system is to be validated (e.g., EFM)

.. attribute:: disclosureSystem

Disclosure system object.  To select the disclosure system, e.g., 'gfm', moduleManager.disclosureSystem.select('gfm').

.. attribute:: validateCalcs

ValidateXbrlCalcs.ValidateCalcsMode

.. attribute:: validateUTR

True for validation of unit type registry

.. attribute:: defaultLang

The default language code for labels selection and views (e.g. 'en-US'), set from the operating system defaults on startup.

Initialization

defaultLang: str

None

formulaOptions: arelle.ModelFormulaObject.FormulaOptions

None

locale: arelle.typing.LocaleDict

None

shutdown()
setLocale() str | None
addToLog(message, messageCode='', file='', refs=[], level=logging.INFO) None

Add a simple info message to the default logger

Parameters:
  • message (str) – Text of message to add to log.

  • messageCode – Message code (e.g., a prefix:id of a standard error)

  • messageCode – str

  • file (str) – File name (and optional line numbers) pertaining to message

  • refs – [{“href”:file,”sourceLine”:lineno},…] pertaining to message

showStatus(message: str | None, clearAfter: int | None = None) None

Provide user feedback on status line of GUI or web page according to type of controller.

Parameters:
  • message – Message to display on status widget.

  • clearAfter – Time, in ms., after which to clear the message (e.g., 5000 for 5 sec.)

viewModelObject(modelXbrl, objectId)

Notify any active views to show and highlight selected object. Generally used to scroll list control to object and highlight it, or if tree control, to find the object and open tree branches as needed for visibility, scroll to and highlight the object.

Parameters:
  • modelXbrl (ModelXbrl) – ModelXbrl (DTS) whose views are to be notified

  • objectId (str) – Selected object id (string format corresponding to ModelObject.objectId() )

reloadViews(modelXbrl: arelle.ModelXbrl) None

Notify all active views to reload and redisplay their entire contents. May be used when loaded model is changed significantly, or when individual object change notifications (by viewModelObject) would be difficult to identify or too numerous.

Parameters:

modelXbrl – ModelXbrl (DTS) whose views are to be reloaded

load(filesource, nextaction=None, taxonomyPackages=None, **kwargs)

Load an entry point modelDocument object(s), which in turn load documents they discover (for the case of instance, taxonomies, and versioning reports), but defer loading instances for test case and RSS feeds.

The modelXbrl that is loaded is ‘stacked’, by this class, so that any modelXbrl operations such as validate, and close, operate on the most recently loaded modelXbrl, and compareDTSes operates on the two most recently loaded modelXbrl’s.

Parameters:
  • filesource (FileSource or str) – may be a FileSource object, with the entry point selected, or string file name (or web URL).

  • nextAction (str) – status line text string, if any, to show upon completion

  • taxonomyPackages – array of URLs of taxonomy packages required for load operation

saveDTSpackage(allDTSes=False)
create(newDocumentType=None, url=None, schemaRefs=None, createModelDocument=True, isEntry=False, errorCaptureLevel=None, initialXml=None, base=None) arelle.ModelXbrl
validate()

Validates the most recently loaded modelXbrl (according to validation properties).

Results of validation will be in log.

compareDTSes(versReportFile, writeReportFile=True)

Compare two most recently loaded DTSes, saving versioning report in to the file name provided.

Parameters:
  • versReportFile (str) – file name in which to save XBRL Versioning Report

  • writeReportFile (bool) – False to prevent writing XBRL Versioning Report file

close(modelXbrl=None)

Closes the specified or most recently loaded modelXbrl

Parameters:

modelXbrl (ModelXbrl) – Specific ModelXbrl to be closed (defaults to last opened ModelXbrl)

loadCustomTransforms()