STILTS is a very useful program, in particular to convert VOTABLE between several serializations. But can be difficult to use outside of TOPCAT. It is as simple as
stilts tcopy ifmt=votable in=table.xml ofmt=fits out=table.fits
to convert from an VOTABLE in xml format to its fits serialization. However, STILTS store most of the metadata of the VOTABLE as bytes in the first extension as BINTABLE, with these comments :
COMMENT The data in this primary HDU consists of bytes which
COMMENT comprise a VOTABLE document.
COMMENT The VOTable describes the metadata of the table contained
COMMENT in the following BINTABLE extension.
COMMENT Such a BINTABLE extension can be used on its own as a perfectly
COMMENT good table, but the information from this HDU may provide some
COMMENT useful additional metadata.
Reading the binary table returns a lengthy array of indecipherable bytes. Hopefully Python can be of some helps, by transforming it into string representation of a bytearray.
from astropy.io import fits
data = str(bytearray(fits.getdata('table.fits', 0)))
This string is human readable but still not very useful in its form. But it can easily be parsed by ElementTree
from lxml import etree
root = etree.fromstring(data)
Now we can easily access all the keys from the VOTABLE, for, e.g. looking for the value of the CreatorDate
PARAM
root.find(".//*[@name='CreatorDate']").attrib['value']