LanguageValues#
- class wikibaseintegrator.models.language_values.LanguageValues[source]#
Bases:
BaseModel- add(language_value)[source]#
Add a LanguageValue object to the list
- Parameters:
language_value (
LanguageValue) – A LanguageValue object- Return type:
- Returns:
The current LanguageValues object
- get(language=None)[source]#
Get a LanguageValue object with the specified language. Use the default language in wbi_config if none specified.
- set(language=None, value=None, action_if_exists=ActionIfExists.REPLACE_ALL)[source]#
Create or update the specified language with the valued passed in arguments.
- Parameters:
language (
str|None, default:None) – The desired language.value (
str|None, default:None) – The desired value of the LanguageValue object. Use None to delete an existing LanguageValue object from the list.action_if_exists (
ActionIfExists, default:ActionIfExists.REPLACE_ALL) – The action if the LanguageValue object is already defined. Can be ActionIfExists.REPLACE_ALL (default) or ActionIfExists.KEEP.
- Return type:
- Returns:
The created or updated LanguageValue. None if there’s no LanguageValue object with this language.
- property values: dict[str, LanguageValue]#
A dict of LanguageValue with the language as key.