Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serialized values all 0 #22

Open
nhippenmeyer opened this issue Sep 16, 2015 · 9 comments
Open

Serialized values all 0 #22

nhippenmeyer opened this issue Sep 16, 2015 · 9 comments
Assignees
Labels

Comments

@nhippenmeyer
Copy link

I've run through the setup and tried parsing this google 10-K form:

http://www.sec.gov/Archives/edgar/data/1288776/000128877614000020/goog-20131231.xml

However when I serialized the data, all values are 0, as seen below. Any idea what's happening here?

MarshalResult(data={u'liabilities': 0.0, u'net_cash_flows_financing_continuing': 0.0, u'revenue': 0.0, u'income_tax_expense_benefit': 0.0, u'income_from_equity_investments': 0.0, u'preferred_stock_dividends': 0.0, u'redeemable_noncontrolling_interest': 0.0, u'extraordary_items_gain_loss': 0.0, u'temporary_equity': 0.0, u'costs_and_expenses': 0.0, u'non_current_assets': 0.0, u'net_cash_flows_discontinued': 0.0, u'net_cash_flows_investing_discontinued': 0.0, u'liabilities_and_equity': 0.0, u'other_operating_income': 0.0, u'operating_income_loss': 0.0, u'income_before_equity_investments': 0.0, u'net_income_parent': 0.0, u'equity': 0.0, u'income_loss': 0.0, u'cost_of_revenue': 0.0, u'operating_expenses': 0.0, u'noncurrent_liabilities': 0.0, u'current_liabilities': 0.0, u'net_cash_flows_investing': 0.0, u'stockholders_equity': 0.0, u'net_income_loss': 0.0, u'net_cash_flows_investing_continuing': 0.0, u'nonoperating_income_loss': 0.0, u'net_cash_flows_financing': 0.0, u'net_income_shareholders': 0.0, u'comprehensive_income': 0.0, u'equity_attributable_interest': 0.0, u'commitments_and_contingencies': 0.0, u'comprehensive_income_parent': 0.0, u'net_cash_flows_operating_discontinued': 0.0, u'comprehensive_income_interest': 0.0, u'other_comprehensive_income': 0.0, u'equity_attributable_parent': 0.0, u'assets': 0.0, u'gross_profit': 0.0, u'net_cash_flows_operating_continuing': 0.0, u'current_assets': 0.0, u'interest_and_debt_expense': 0.0, u'net_income_loss_noncontrolling': 0.0, u'net_cash_flows_operating': 0.0}, errors={})
@pythonliuj
Copy link

results all zero for test example https://github.com/greedo/python-xbrl/tree/master/tests/goog-20140630.xml

@greedo greedo added the bug label Sep 30, 2015
@greedo greedo self-assigned this Sep 30, 2015
@greedo
Copy link
Owner

greedo commented Sep 30, 2015

@nhippenmeyer I am having problems reproducing this issue, could you post the code you are using. Thanks!

@pythonliuj
Copy link

(py1) C:\pyxbrl\python-xbrl-master\xbrl>ipython gaap.py
{'liabilities': 0.0, 'net_cash_flows_financing_continuing': 0.0, 'revenue': 0.0,
'income_tax_expense_benefit': 0.0, 'common_shares_authorized': 0.0, 'income_fro
m_equity_investments': 0.0, 'preferred_stock_dividends': 0.0, 'redeemable_noncon
trolling_interest': 0.0, 'extraordary_items_gain_loss': 0.0, 'temporary_equity':
0.0, 'costs_and_expenses': 0.0, 'non_current_assets': 0.0, 'net_cash_flows_disc
ontinued': 0.0, 'net_cash_flows_investing_discontinued': 0.0, 'liabilities_and_e
quity': 0.0, 'other_operating_income': 0.0, 'operating_income_loss': 0.0, 'incom
e_before_equity_investments': 0.0, 'net_income_parent': 0.0, 'equity': 0.0, 'inc
ome_loss': 0.0, 'cost_of_revenue': 0.0, 'operating_expenses': 0.0, 'noncurrent_l
iabilities': 0.0, 'current_liabilities': 0.0, 'net_cash_flows_investing': 0.0, '
stockholders_equity': 0.0, 'net_income_loss': 0.0, 'net_cash_flows_investing_con
tinuing': 0.0, 'nonoperating_income_loss': 0.0, 'common_shares_outstanding': 0.0
, 'net_cash_flows_financing': 0.0, 'net_income_shareholders': 0.0, 'comprehensiv
e_income': 0.0, 'equity_attributable_interest': 0.0, 'commitments_and_contingenc
ies': 0.0, 'comprehensive_income_parent': 0.0, 'net_cash_flows_operating_discont
inued': 0.0, 'comprehensive_income_interest': 0.0, 'other_comprehensive_income':
0.0, 'equity_attributable_parent': 0.0, 'assets': 0.0, 'common_shares_issued':
0.0, 'gross_profit': 0.0, 'net_cash_flows_operating_continuing': 0.0, 'current_a
ssets': 0.0, 'interest_and_debt_expense': 0.0, 'net_income_loss_noncontrolling':
0.0, 'net_cash_flows_operating': 0.0}

@greedo
Copy link
Owner

greedo commented Oct 1, 2015

@nhippenmeyer @pythonliuj again could you post the exact code you are using when parsing. Thanks!

@arosen32
Copy link

xbrl_parser = XBRLParser()
xbrl = xbrl_parser.parse('aapl-20150627.xml')
gaap_obj = xbrl_parser.parseGAAP(xbrl, doc_date='20150627', doc_type='10-Q', context='current')
result = serializer.dump(gaap_obj)

Gives me a dictionary with all 0s

The file is at: http://www.sec.gov/Archives/edgar/data/320193/000119312515259935/aapl-20150627.xml

@greedo
Copy link
Owner

greedo commented Oct 15, 2015

from xbrl import XBRLParser, GAAP, GAAPSerializer

xbrl_parser = XBRLParser()
xbrl = xbrl_parser.parse('aapl-20150627.xml')
gaap_obj = xbrl_parser.parseGAAP(xbrl, doc_date='20150627', doc_type='10-Q', context='current')
serializer = GAAPSerializer()
result = serializer.dump(gaap_obj)

print result

This is the code I am using @NoMoSnacks and I am getting data

@gdsaxton
Copy link

gdsaxton commented Oct 7, 2017

@greedo I just ran your code above (omitting the doc_type variable, which caused an error) and am getting mostly zeros as well. Perhaps the GAAP parser needs updating?

@akudan
Copy link

akudan commented Nov 16, 2020

Any progress on this issue? Also running into this problem.

@victoriaplummer
Copy link

victoriaplummer commented Dec 1, 2021

Actually - I think my doc is not an XML file - I'm v new to this.

I'm also running into this problem with a 10-Q file. Is doc_type no longer needed?

Code

        print('Parsing file {index} of {length}'.format(index=files.index(file)+1, length=len(files)))
        xbrl = xbrl_parser.parse(xml_filename)
        gaap_obj = xbrl_parser.parseGAAP(xbrl, doc_date=doc_date)
        serializer = GAAPSerializer()
        result = serializer.dump(gaap_obj)
        print(result)

Result

{'non_current_assets': 0.0, 'preferred_stock_dividends': 0.0, 'net_cash_flows_investing_continuing': 0.0, 'liabilities': 0.0, 'net_income_loss_noncontrolling': 0.0, 'net_cash_flows_investing_discontinued': 0.0, 'stockholders_equity': 0.0, 'extraordary_items_gain_loss': 0.0, 'common_shares_outstanding': 0.0, 'operating_expenses': 0.0, 'current_liabilities': 0.0, 'costs_and_expenses': 0.0, 'net_income_parent': 0.0, 'operating_income_loss': 0.0, 'net_cash_flows_operating_continuing': 0.0, 'net_cash_flows_operating': 0.0, 'comprehensive_income': 0.0, 'net_cash_flows_financing_continuing': 0.0, 'noncurrent_liabilities': 0.0, 'interest_and_debt_expense': 0.0, 'net_cash_flows_operating_discontinued': 0.0, 'cost_of_revenue': 0.0, 'net_cash_flows_discontinued': 0.0, 'equity': 0.0, 'equity_attributable_interest': 0.0, 'net_income_loss': 0.0, 'income_tax_expense_benefit': 0.0, 'current_assets': 0.0, 'liabilities_and_equity': 0.0, 'common_shares_authorized': 0.0, 'net_income_shareholders': 0.0, 'equity_attributable_parent': 0.0, 'comprehensive_income_interest': 0.0, 'gross_profit': 0.0, 'other_operating_income': 0.0, 'income_loss': 0.0, 'temporary_equity': 0.0, 'nonoperating_income_loss': 0.0, 'net_cash_flows_investing': 0.0, 'other_comprehensive_income': 0.0, 'assets': 0.0, 'commitments_and_contingencies': 0.0, 'redeemable_noncontrolling_interest': 0.0, 'net_cash_flows_financing': 0.0, 'income_from_equity_investments': 0.0, 'revenue': 0.0, 'income_before_equity_investments': 0.0, 'common_shares_issued': 0.0, 'comprehensive_income_parent': 0.0}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants