edit_entity#
- wikibaseintegrator.wbi_helpers.edit_entity(data, id=None, type=None, baserevid=None, summary=None, clear=False, is_bot=False, tags=None, site=None, title=None, max_request_size=None, **kwargs)[source]#
Creates a single new Wikibase entity and modifies it with serialised information.
- Parameters:
data (
dict) – The serialized object that is used as the data source. A newly created entity will be assigned an ‘id’.id (
str|None, default:None) – The identifier for the entity, including the prefix. Use either id or site and title together.type (
str|None, default:None) – Set this to the type of the entity to be created. One of the following values: form, item, lexeme, property, sensebaserevid (
int|None, default:None) – The numeric identifier for the revision to base the modification on. This is used for detecting conflicts during save.summary (
str|None, default:None) – Summary for the edit. Will be prepended by an automatically generated comment.clear (
bool, default:False) – If set, the complete entity is emptied before proceeding. The entity will not be saved before it is filled with the “data”, possibly with parts excluded.is_bot (
bool, default:False) – Mark this edit as bot.login – A login instance
tags (
list[str] |None, default:None) – Change tags to apply to the revision.site (
str|None, default:None) – An identifier for the site on which the page resides. Use together with title to make a complete sitelink.title (
str|None, default:None) – Title of the page to associate. Use together with site to make a complete sitelink.max_request_size (
int|None, default:None) – Maximum form-encoded size of the data, in bytes. Larger data is written with several edits: the first one with everything but the statements and as many statements as fit, then the remaining statements. The edits are not atomic: if one fails, the previous ones are kept. Default config[‘MAX_REQUEST_SIZE’] (None, never split).kwargs (
Any) – More arguments for Python requests
- Return type:
- Returns:
The answer from the Wikibase API, of the last edit when the data is split