Stream parsing of VOTables.
This module builds on a shallow wrapping of expat in utils.iterparse. There is an “almost-tight” parsing loop in the parse method. It builds an xmlstan tree (mainly through the _processNodeDefault method).
this is a sentinel element used when an element is not known but robust parsing is requested.
These should not end up in a DOM, but if they do, they’re silent.
They’re designed to largely behave like stanxml Elements; it can’t autoconstruct, though.
parse(inFile, watchset=, raiseOnInvalid=True)[source]¶
returns an iterator yielding items of interest.
inFile is a something that supports read(bytes)
watchset is a sequence of items of VOTable you want yielded. By default, that’s just VOTable.TABLE. You may want to see INFO or PARAM of certain protocols.
parseBytes(string, watchset=, raiseOnInvalid=True)[source]¶
returns an iterator yielding pairs of (table definition, row iterator).
string contains a VOTable literal as bytes (where we fall back to utf-8 encoding strings if necessary).