from ast import literal_eval python code example Example: ast python import ast ast.literal_eval(str(hdf))