9
I'm using lxml.etree.iterparse() to iterate through a large XML file.
I would like to know how far I've got in the parsing of the input file, so that I might get a progress indicator.
My first idea was to use os.stat( filename ).st_size to know how big is my XML file, then as I'm getting events from the parser, retrieve the current position in the file. But I can't figure out how lxml.etree could give me access to its internal position. iterparse() is taking a filename as its source argument, so I can't open myself the file and call its tell() method to known how many bytes have been read so far.
Are you aware of any lxml.etree built-in indicator for current parser progression ? Or do you have an idea of integrating such a progression ?