greedo / python-xbrl

xbrl parser written in Python :bulb:

Home Page:https://pypi.python.org/pypi/python-xbrl

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Parsing error on AAPL's most recent filing.

greedo opened this issue · comments

Parsing error is occurring with
http://www.sec.gov/Archives/edgar/data/320193/000119312514383437/aapl-20140927.xml

xbrl = XBRLParser.parse(file("aapl-20140927.xml"))

And this is the error I get back:
AttributeError Traceback (most recent call last)
in ()
----> 1 xbrl = XBRLParser.parse(file("aapl-20140927.xml"))

C:\Users\PJE\AppData\Local\Enthought\Canopy32\User\lib\site-packages\xbrl\xbrl.pyc in parse(self, file_handle)
76 # lookahead to see if we need a custom leading element
77 lookahead = xbrl.find(name=re.compile("context",
---> 78 re.IGNORECASE | re.MULTILINE)).name
79 if ":" in lookahead:
80 self.xbrl_base = lookahead.split(":")[0] + ":"

AttributeError: 'NoneType' object has no attribute 'name'

Issue appears to be fixed now.

I just got this exact error! how did you fix it? @greedo

I just downloaded this package and tried running the gaap.py. I keep getting the AttributeError - can you please tell me what I'm missing here. Installed all packages and everything looks in order..

Attached is the error message:

C:\Python27\python.exe C:/Learning/PythonWorkspace/projects/xbrlBaba/examples/gaap.py
Traceback (most recent call last):
File "C:/Learning/PythonWorkspace/projects/xbrlBaba/examples/gaap.py", line 9, in
xbrl = xbrl_parser.parse(file("../tests/sam-20130629.xml"))
File "C:\Learning\PythonWorkspace\projects\xbrlBaba\xbrl\xbrl.py", line 80, in parse
re.IGNORECASE | re.MULTILINE)).name
AttributeError: 'NoneType' object has no attribute 'name'

Process finished with exit code 1