input_list = [{'a': 'tata', 'b': 'foo'}, {'a': 'pipo', 'b': 'titi'}, {'a':
    'pipo', 'b': 'toto'}, {'a': 'tata', 'b': 'bar'}]
{k: [v for v in input_list if v['a'] == k] for k, val in itertools.groupby(
    input_list, lambda x: x['a'])}
Python: group list items in a dict