manusimidt / py-xbrl

Python-based parser for parsing XBRL and iXBRL files
https://py-xbrl.readthedocs.io/en/latest/
GNU General Public License v3.0
100 stars 37 forks source link

Example fails #32

Closed mrx23dot closed 3 years ago

mrx23dot commented 3 years ago

How to use parse_instance? Please update example.

xbrlParser = XbrlParser(cache)
xbrl_url = 'https://www.sec.gov/Archives/edgar/data/789019/000156459017014900/msft-20170630.xml'
inst: XbrlInstance = XbrlParser.parse_instance(xbrl_url)

File "C:\tmp\SECgov\parse_sec.py", line 18, in inst: XbrlInstance = XbrlParser.parse_instance(xbrl_url) TypeError: parse_instance() missing 1 required positional argument: 'url'

xbrlParser = XbrlParser(cache)
xbrl_url = 'https://www.sec.gov/Archives/edgar/data/789019/000156459017014900/msft-20170630.xml'
inst: XbrlInstance = XbrlParser.parse_instance(url=xbrl_url)

File "C:\tmp\SECgov\parse_sec.py", line 18, in inst: XbrlInstance = XbrlParser.parse_instance(url=xbrl_url) TypeError: parse_instance() missing 1 required positional argument: 'self'

manusimidt commented 3 years ago

@mrx23dot Thank you for filing the issue. Was a capitalization error. change

inst: XbrlInstance = XbrlParser.parse_instance(url=xbrl_url)

to

inst: XbrlInstance = xbrlParser.parse_instance(url=xbrl_url)
mrx23dot commented 3 years ago

Thank you!