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')
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) result = len(custom_obj()) assert result == 13
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')
xbrl = xbrl_parser.parse(file("../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()
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())
# 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())