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
109 stars 40 forks source link

Index out of range #139

Open pvmagacho-nde opened 1 month ago

pvmagacho-nde commented 1 month ago

XBRL document These are the document links (Filing ID = 0001213900-23-084801):

Describe the bug Index out of range.

manusimidt commented 1 month ago

The problem is that the Filer just has an error in the XBRL.

<ix:nonNumeric contextRef="c0" 
continuedAt="_DocumentPeriodEndDate-c0_cont_1"
format="ixt:date-monthname-day-year-en" 
name="dei:DocumentPeriodEndDate">September</ix:nonNumeric>

You can see that the filer clearly states that the format is date-monthname-day-year-en which means that py-xbrl expects to have a month, a day and a year (like "September, 15 2025"). However, the filer only provided a month which is why the error appears.

I agree that the error message could get some improvements (like "Invalid XBRL - The filer uses a format which is not compliant to the provided value") but apart from that I don't think there is much you can do. Except to implement #84 and rather parse the document incorrectly / incompletely and just throw a warning