Last week we added to our XBRL Merger script, giving it the ability to export files and compare the exported files to see if they were able to be merged. This week, we’ll take it another step further by adding in the ability to read the XBRL instance files into data structures, add some debug information, and add a progress bar to the run function. This week introduces the concept of debug print messages. Often when writing a script, you will encounter an issue where you’re not sure what the actual value of a variable is. Depending on the integrated development environment (IDE) being used to write the code, you can sometimes step through the code with breakpoints and inspect the values for each variable. While we’re going to be adding that feature to GoFiler’s Legato IDE, for now we find it helpful to insert various functions that print variables to a console. By adding a special function to do this, you can make showing/hiding debug information very easy. See the section on the debug_message function’s code below for more.
Continue reading "LDC #33: XBRL Merger, Part 3" »