def to_dicts(element):
obj = {'tag': element.tag,
'attrs': element.attrs,
'childs': [to_dicts(child) for child in element]}
return obj
p = re.compile(ur"^(?P<name>.+?)[ ]*-[ ]*(?P<value>\d+?)$", flags=re.M|re.U)
# -*- coding: utf-8 -*-
import re
text = u"""Вася - 10
Ваня - 20
Петя - 30"""
d = dict(re.findall(u"^(.+?) - (\d+?)$", text, flags=re.M|re.U))
print d
p = re.compile(u"^(?P<name>.+?) - (?P<value>\d+?)$", flags=re.M|re.U)
d = [match.groupdict() for match in p.finditer(text)]