def camelize_singular(txt):
"""
Produce a 'camelized' and singular class name.
e.g. 'the_underscores' -> 'TheUnderscore'
"""
camelize = str(txt[0].upper() +\
re.sub(r'_([a-z])',
lambda m: m.group(1).upper(), txt[1:]))
return inflect.engine().singular_noun(camelize)
评论列表
文章目录