Examining the attributes of the style object should do the trick. I suggest embedding a javascript library like jQuery and using that to do this easily. See the calibre viewer source for how to do this (calibre uses it to implement the reference mode, bookmarks, etc). If you need more clarification, feel free to ask. I'm just a littel hassled today (as you saw in the thread on covers), so I may take a little while to give you a detailed response.
EDIT: oops I should have said javascript to C bridge (I forgot Sigil was not written in python