def __init__(self): """ Create a sppasMetaData instance. Add a GUID in the dictionary of metadata, with key "id". """ # Dictionary with key and value self.__metadata = OrderedDict() self.__metadata['id'] = sppasGUID().get()
def create_meta_id(self): """ Create a metadata with 'id' as key and a GUID as value. :returns: GUID identifier """ guid = sppasGUID().get() self.set_meta("id", guid) return guid
def set_name(self, name=None): """ Set the name of the transcription. :param name: (str or None) The identifier name or None. :returns: the name """ if name is None: name = sppasGUID().get() su = sppasUnicode(name) self._name = su.to_strip() return self._name
def gen_id(self): """Re-generate an 'id'.""" self.__metadata['id'] = sppasGUID().get()