Source code for wikibaseintegrator.datatypes.musicalnotation
from typing import Optional
from wikibaseintegrator.datatypes.string import String
[docs]
class MusicalNotation(String):
"""
Implements the Wikibase data type 'musical-notation'
"""
DTYPE = 'musical-notation'
[docs]
def set_value(self, value: Optional[str] = None):
assert isinstance(value, str) or value is None, f"Expected str, found {type(value)} ({value})"
if value:
self.mainsnak.datavalue = {
'value': value,
'type': 'string'
}