Closed chinchien-lin closed 1 year ago
For Tu2 steps:
Developed a MetadataEditor class for editing all metadata files(code_description, code_parameters, dataset_description, manifest, performances, resources, samples, subjects, submission). we can use MetadataEditor to edit all of them at the same time with these functions:
metadataEditor.add_values(*values, field_name='', header='', append=False)
metadataEditor.add_values(*values, field_name='contributor role')
metadataEditor.add_values(*values)
, in this way we don't need to consider the field name and header name. if we want add more rows values, we need set append = True. Then you can recall this function again. the second value list will be added into the next row.metadataEditor.add_values(*values, header='name', append=True)
metadataEditor.get_values(field_name)
code_description and dataset_description
files, we need to provide the row name to get the values of that row.metadataEditor.remove_values(*values, field_name)
code_description and dataset_description
files, we need to set the row name for the field_namemetadataEditor.clear_values(field_name='')
Contributor name
row_name, we can ignore user types like this Contributor name
, Contributor Name
,CONtributor naMe
, contributorname
.etc, these inputs are all match the Contributor Name
.
set_field
to add_value/add_valuesDescribing the dataset