def print_dict(d):
    new = {}
for k, v in d.items():
    if isinstance(v, dict):
        v = print_dict(v)
new[k.replace('.', '-')] = v
Python recursively replace character in keys of nested dictionary?