Well isn't Calibre doing exactly part of the job? Parsing epubs in python? I notified Kovid about the idea here... Interested what he might have to say.
I was thinking about the problem since here: https://www.mobileread.com/forums/sho...6&postcount=15
and tought about how to best present the idea to the python savvy ones on MR, then Luke wrote here that such a thing is already in the making - sparing me a definitely heavy task of composing a teal deer post hoping some coders might find it useful too.
We know what's commonly said about a user with an idea don't we?
Personally I think such a finalizing tool could make epubs compatible to the majority of commercial font licenses.
And THAT would be a hell of a breakthrough in production of commercially usable epubs.