Reading or writing a dataset with custom Python code