the-library-code / dspace-rest-python

DSpace REST API Client Library
BSD 3-Clause "New" or "Revised" License
25 stars 21 forks source link

Helper class methods for constructing resource metadata #1

Open kshepherd opened 2 years ago

kshepherd commented 2 years ago

At the moment, constructing an actual API resource object from scratch (eg. for creation) is mostly left up to the developer. It would be nice to have class methods for base DSO and if applicable, higher-level objects so that it is easy to add, update or otherwise manipulate a metadata value(s) (with field, value, language, authority, confidence as arguments) in a DSO that we're putting together in the python script. It could work something like

item = new Item() item.add_metadata('dc.creator', 'Family-name, First-name', 'en') (authority=None, confidence=-1 defaults)

Or, we could make item.metadata use a Metadata class and add methods to that like item.metadata.add(....) item.metadata.clear_by_field('dc.creator')

And so on.