-2

from xbrl import XBRLParser, GAAP, GAAPSerializer

import bs4, lxml

xbrl = xbrl_parser.parseGAAP(file(r"C:\Users\anant\NETRA\https---archives.nseindia.com-corporate-xbrl-INDAS_90168_794349_14022023041135.xml.url"))

here I am trying to use a python-xbrl package. the error of "name 'file' is not defined" is showing up.

please guide me, resolving this issue.

  • Please familiarise yourself with the Stack Overflow guidelines (https://stackoverflow.com/help/how-to-ask). In particular: "search and research" - pasting this error message into a search engine will give you the answer to your question. "spelling, grammar and punctuation are important" - please capitalise sentences. Also, please include the _full_ error message that you receive. – pdw Apr 10 '23 at 07:25

1 Answers1

0

It looks like you're trying to run Python 2 code in Python 3. See Python 3 doesn't have the file function.

As a more general point, it looks like you're trying to read non-US-GAAP XBRL. The python-xbrl library is not a general purpose XBRL processor, and is unlikely to work with XBRL from other sources. I would recommend looking at using a different XBRL processor, such as Arelle.

pdw
  • 884
  • 4
  • 5