Convert String To Array Of Objects In Python