Surprisingly it is not *quite* all. The format specification mini language parser is not exposed for use. This has bummed me out more than once in the past.
Here is my attempt at recreating it from a couple years ago. Do with it what you will.
>>> r=r'(([\s\S])?([<>=\^]))?([\+\- ])?([#])?([0])?(\d)*([,])?((\.)(\d)*)?([sbcdoxXneEfFgGn%])?'
>>>
>>> from collections import namedtuple as nt
>>> FormatSpec = nt('FormatSpec', 'fill align sign alt zero_padding width comma decimal precision type')
>>>
>>> import re
>>> spec = FormatSpec(*re.fullmatch(r,'x>5.2f').group(2,3,4,5,6,7,8,10,11,12)) # skip groups not interested in
>>> spec
FormatSpec(fill='x', align='>', sign=None, alt=None, zero_padding=None, width='5', comma=None, decimal='.', precision='2', type='f')
>>> ''.join(s for s in spec if s is not None) # recreate the input spec
'x>5.2f'
---
Ricky.
"I've never met a Kentucky man who wasn't either thinking about going home or actually going home." - Happy Chandler