当前位置: 首页>>代码示例>>Python>>正文


Python XBRLParser.parseCustom方法代码示例

本文整理汇总了Python中xbrl.XBRLParser.parseCustom方法的典型用法代码示例。如果您正苦于以下问题:Python XBRLParser.parseCustom方法的具体用法?Python XBRLParser.parseCustom怎么用?Python XBRLParser.parseCustom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在xbrl.XBRLParser的用法示例。


在下文中一共展示了XBRLParser.parseCustom方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_parse_Custom10Q_RRDonnelley

# 需要导入模块: from xbrl import XBRLParser [as 别名]
# 或者: from xbrl.XBRLParser import parseCustom [as 别名]
def test_parse_Custom10Q_RRDonnelley():

    xbrl_parser = XBRLParser(0)
    file_to_parse = "tests/sam-20130629.xml"
    xbrl = xbrl_parser.parse(file_to_parse)
    custom_obj = xbrl_parser.parseCustom(xbrl)

    if six.PY3:

        result = len(custom_obj())

        assert result == 13

    if six.PY2 and not __pypy__:

        result = custom_obj()

        assert result[0] == ('conversionofclassbcommonstocktoclassacommonstockshares', '100000')
        assert result[1] == ('percentageofproductionvolumes', '0.90')
        assert result[2] == ('sharebasedcompensationarrangementbysharebasedpaymentawardoptionstovestineachtranche', '5000')
        assert result[3] == ('weightedaveragenumberofsharesoutstandingbasicincludingnonvestedparticipatingsecurities', '12866000')
        assert result[4] == ('incrementalcommonsharesattributabletoconversionofcommonstock', '4007000')
        assert result[5] == ('sharebasedcompensationarrangementbysharebasedpaymentawardinvestmentsharesweightedaveragegrantdat', '59.62')
        assert result[6] == ('incomeallocatedtoequityinstrumentsotherthanoptionnonvested', '7000')
        assert result[7] == ('netproceedsfromsaleofinvestmentshares', '531000')
        assert result[8] == ('weightedaveragenumberofbasicsharesoutstandingequityinstrumentsotherthanoptionnonvested', '94000')
        assert result[9] == ('sharebasedcompensationarrangementbysharebasedpaymentawardemployeeinvestmentsharespurchase', '12894')
        assert result[10] == ('provisionforreductionofdoubtfulaccounts', '-28000')
        assert result[11] == ('receiptofgovernmentgrantsforfacilitiesexpansion', '770000')
        assert result[12] == ('netincomelossallocatedtoequityinstrumentsotherthanoptionnonvested', '-143000')
开发者ID:greedo,项目名称:python-xbrl,代码行数:32,代码来源:test_parse.py

示例2: GAAPSerializer

# 需要导入模块: from xbrl import XBRLParser [as 别名]
# 或者: from xbrl.XBRLParser import parseCustom [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())
开发者ID:greedo,项目名称:python-xbrl,代码行数:32,代码来源:gaap.py

示例3: GAAPSerializer

# 需要导入模块: from xbrl import XBRLParser [as 别名]
# 或者: from xbrl.XBRLParser import parseCustom [as 别名]
# Parse just the GAAP data from the xbrl object
gaap_obj = xbrl_parser.parseGAAP(xbrl,
                                 doc_date="20131228",
                                 context="current",
                                 ignore_errors=0)

# Serialize the GAAP data
serializer = GAAPSerializer()
result = serializer.dump(gaap_obj)

# Print out the serialized GAAP data
print(result.data)


# 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.data)

# Parse the custom data from the xbrl object
data_obj = xbrl_parser.parseCustom(xbrl)

# Print out the custom data
print(data_obj())
开发者ID:Gwill,项目名称:python-xbrl,代码行数:31,代码来源:gaap.py


注:本文中的xbrl.XBRLParser.parseCustom方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。