本文整理汇总了Python中xbrl.XBRLParser.parseDEI方法的典型用法代码示例。如果您正苦于以下问题:Python XBRLParser.parseDEI方法的具体用法?Python XBRLParser.parseDEI怎么用?Python XBRLParser.parseDEI使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xbrl.XBRLParser
的用法示例。
在下文中一共展示了XBRLParser.parseDEI方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_parse_DEI10Q_RRDonnelley
# 需要导入模块: from xbrl import XBRLParser [as 别名]
# 或者: from xbrl.XBRLParser import parseDEI [as 别名]
def test_parse_DEI10Q_RRDonnelley():
xbrl_parser = XBRLParser(0)
file_to_parse = "tests/sam-20130629.xml"
xbrl = xbrl_parser.parse(file_to_parse)
dei_obj = xbrl_parser.parseDEI(xbrl)
serializer = DEISerializer()
result = serializer.dump(dei_obj)
assert result.data['trading_symbol'] == "SAM"
assert result.data['company_name'] == "BOSTON BEER CO INC"
assert result.data['shares_outstanding'] == 4007355.0
assert result.data['public_float'] == 0.0
示例2: GAAPSerializer
# 需要导入模块: from xbrl import XBRLParser [as 别名]
# 或者: from xbrl.XBRLParser import parseDEI [as 别名]
xbrl = xbrl_parser.parse("../tests/sam-20130629.xml")
# Parse just the GAAP data from the xbrl object
gaap_obj = xbrl_parser.parseGAAP(xbrl,
doc_date="20130629",
context="current",
ignore_errors=0)
# Serialize the GAAP data
serializer = GAAPSerializer()
result = serializer.dump(gaap_obj)
# Print out the serialized GAAP data
print(result)
# Parse just the DEI data from the xbrl object
dei_obj = xbrl_parser.parseDEI(xbrl)
# Serialize the DEI data
serializer = DEISerializer()
result = serializer.dump(dei_obj)
# Print out the serialized DEI data
print(result)
# Parse just the Custom data from the xbrl object
custom_obj = xbrl_parser.parseCustom(xbrl)
# Print out the Custom data as an array of tuples
print(custom_obj())