iXBRLViewerPlugin.iXBRLViewer¶
Module Contents¶
Classes¶
Class for building a 1:1 map of prefixes to namespace URIs Will attempt to use a provided, preferred prefix, but will uniquify as required. |
|
Functions¶
Data¶
API¶
- iXBRLViewerPlugin.iXBRLViewer.REPORT_TYPE_EXTENSIONS¶
(‘.xbrl’, ‘.xhtml’, ‘.html’, ‘.htm’, ‘.json’)
- iXBRLViewerPlugin.iXBRLViewer.UNRECOGNIZED_LINKBASE_LOCAL_DOCUMENTS_TYPE¶
‘unrecognizedLinkbase’
- iXBRLViewerPlugin.iXBRLViewer.LINK_QNAME_TO_LOCAL_DOCUMENTS_LINKBASE_TYPE¶
None
- iXBRLViewerPlugin.iXBRLViewer.WIDER_NARROWER_ARCROLE¶
‘http://www.esma.europa.eu/xbrl/esef/arcrole/wider-narrower’
- class iXBRLViewerPlugin.iXBRLViewer.NamespaceMap¶
Class for building a 1:1 map of prefixes to namespace URIs Will attempt to use a provided, preferred prefix, but will uniquify as required.
Initialization
- getPrefix(ns: str, preferredPrefix: str | None = None) str¶
Get the prefix for the specified namespace.
If no prefix is yet defined, define one using the preferred prefix, if provided and not yet used, otherwise add a number to the end of the preferred prefix (or the string “ns”)
- qname(qname: arelle.ModelValue.QName) str¶
- exception iXBRLViewerPlugin.iXBRLViewer.IXBRLViewerBuilderError¶
Bases:
Exception
- iXBRLViewerPlugin.iXBRLViewer.isInlineDoc(doc: arelle.ModelDocument.ModelDocument | None) bool¶
- class iXBRLViewerPlugin.iXBRLViewer.IXBRLViewerBuilder(cntlr: arelle.Cntlr.Cntlr, basenameSuffix: str = '', useStubViewer: bool = False, features: dict[str, Any] | None = None)¶
Initialization
- outputFilename(filename: str) str¶
- lineWrap(s: str, n: int = 80) str¶
- dateFormat(d: str) str¶
Strip the time component from an ISO date if it’s zero
- escapeJSONForScriptTag(s: str) str¶
JSON encodes XML special characters XML and HTML apply difference escaping rules to content within script tags and we need our output to be valid XML, but treated as HTML by browsers.
If we allow XML escaping to occur in a script tag, browsers treating the document as HTML won’t unescape it. If we don’t escape XML special characters, it won’t be valid XML. We avoid this whole mess by escaping XML special characters using JSON string escapes. This is only safe to do because < > and & can’t occur outside a string in JSON. It can’t safely be used on JS.
- addRoleDefinition(report: arelle.ModelXbrl.ModelXbrl, elr: str) None¶
- addConcept(report: arelle.ModelXbrl.ModelXbrl, concept: arelle.ModelDtsObject.ModelConcept | None, dimensionType: str | None = None) None¶
- treeWalk(rels: arelle.ModelRelationshipSet.ModelRelationshipSet, item: Any, indent: int = 0) None¶
- getRelationships(report: arelle.ModelXbrl.ModelXbrl) dict[str, dict[str, dict[str, list[dict[str, str]]]]]¶
- validationErrors() list[dict[str, str]]¶
- addFact(report: arelle.ModelXbrl.ModelXbrl, f: arelle.ModelInstanceObject.ModelInlineFact) None¶
- oimUnitString(unit: arelle.ModelInstanceObject.ModelUnit) str¶
Returns an OIM-format string representation of the given ModelUnit. See https://www.xbrl.org/Specification/oim-common/REC-2021-10-13/oim-common-REC-2021-10-13.html#term-unit-string-representation
- Parameters:
unit – ModelUnit
- Returns:
String representation of unit (OIM format)
- addViewerData(viewerFile: iXBRLViewerPlugin.iXBRLViewer.iXBRLViewerFile, scriptUrl: str) bool¶
- getStubDocument() lxml.etree._ElementTree[lxml.etree._Element]¶
- newTargetReport(target: str | None) dict[str, Any]¶
- addSourceReport() dict[str, list[Any]]¶
- processModel(report: arelle.ModelXbrl.ModelXbrl) None¶
- createViewer(scriptUrl: str = DEFAULT_JS_FILENAME, showValidations: bool = True, packageDownloadURL: str | None = None) iXBRLViewerPlugin.iXBRLViewer.iXBRLViewer | None¶
Create an iXBRL file with XBRL data as a JSON blob, and script tags added.
- Parameters:
scriptUrl – The
srcvalue of the script tag that loads the viewer script.showValidations – True if validation errors should be included in output taxonomy data.
- Returns:
An iXBRLViewer instance that is ready to be saved.
- class iXBRLViewerPlugin.iXBRLViewer.iXBRLViewerFile(filename: str, xmlDocument: lxml.etree._ElementTree[lxml.etree._Element])¶
Initialization
- class iXBRLViewerPlugin.iXBRLViewer.iXBRLViewer(cntlr: arelle.Cntlr.Cntlr)¶
Initialization
- addReportAssets(assets: list[str]) None¶
- addFile(ivf: iXBRLViewerPlugin.iXBRLViewer.iXBRLViewerFile) None¶
- property files: list[iXBRLViewerPlugin.iXBRLViewer.iXBRLViewerFile]¶
- addFilingDoc(filingDocuments: str) None¶
- save(destination: io.BytesIO | str, zipOutput: bool = False, copyScriptPath: pathlib.Path | None = None) None¶
Save the iXBRL viewer.
- Parameters:
destination – The target that viewer data/files will be written to (path to file/directory, or a file object itself).
zipOutput – True if the destination is a zip archive.
copyScriptPath – If provided, the path from where the viewer JS will be copied into the output from.
- _copyScript(destDirectory: pathlib.Path, scriptPath: pathlib.Path) None¶