读取Python中的XBRL和iXBRL文件
Contents
[
Hide
]
读取Python中的XBRL实例文件
Aspose.Finance支持读取XBRL文档。为此,您可以通过将有效的 XBRL 实例文件的名称作为参数传递来使用 XbrlDocument 类。
以下 Python 代码片段演示了读取 XBRL 实例文档。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document = XbrlDocument(os.path.join(sourceDir, "IdScopeContextPeriodStartAfterEnd.xml")) | |
xbrlInstances = document.xbrl_instances | |
xbrlInstance = xbrlInstances[0] | |
facts = xbrlInstance.facts | |
schemaRefs = xbrlInstance.schema_refs | |
contexts = xbrlInstance.contexts | |
units = xbrlInstance.units |
读取Python中的iXBRL文件
Aspose.Finance支持读取iXBRL实例文档。为此,API 提供了 InlineXbrlDocument 类。 InlineXbrlDocument 类的构造函数接受有效的 iXBRL 文件的名称。
以下 Python 代码片段演示了读取 iXBRL 实例文档。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document = InlineXbrlDocument(iXbrlFilePath + @"account_first.html") | |
inlineFacts = document.facts | |
contexts = document.contexts | |
units = document.units |