I wrote this script to collect evidence of the number of days worked for the purpose of claiming some government tax credits.
I'm looking for some ways to clean it up. I'm especially wondering if there is a cleaner way to uniqueify a list than list(set(my_list)
and maybe a better way to do:
d = dict(zip(commiters, [0 for x in xrange(len(commiters))]))
import os
from pprint import pprint
lines = os.popen('git log --all').read().split('\n')
author_lines = filter(lambda str: str.startswith('Author'), lines)
date_lines = filter(lambda str: str.startswith('Date'), lines)
author_lines = map(lambda str: str[8:], author_lines)
date_lines = map(lambda str: str[8:18].strip(), date_lines)
lines = zip(author_lines, date_lines)
lines = sorted(list(set(lines)), key = lambda tup: tup[0])
commiters = list(set(map(lambda tup: tup[0], lines)))
d = dict(zip(commiters, [0 for x in xrange(len(commiters))]))
for item in lines:
d[item[0]] += 1
pprint(d)