Format dirty sources in json in python client