greedo / python-xbrl

xbrl parser written in Python :bulb:
https://pypi.python.org/pypi/python-xbrl
Apache License 2.0
220 stars 76 forks source link

Parsing error on AAPL's most recent filing. #13

Open greedo opened 9 years ago

greedo commented 9 years ago

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'
greedo commented 9 years ago

Issue appears to be fixed now.

lhsu1 commented 8 years ago

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

SushantReddy commented 8 years ago

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