******************************* :mod:`site` --- MediaWiki sites ******************************* .. py:module:: site :synopsis: Library module representing MediaWiki sites (wikis) .. automodule:: pywikibot.site :no-members: :noindex: :mod:`BaseSite` --- Base Class for Sites ================================================================== .. py:module:: site._basesite :synopsis: Objects with site methods independent of the communication interface .. automodule:: pywikibot.site._basesite .. autoclass:: BaseSite :members: :special-members: __getattr__ .. method:: category_redirects(fallback: str = '_default') Return list of category redirect templates. .. seealso:: :meth:`family.Family.category_redirects` :rtype: list[str] .. method:: get_edit_restricted_templates() Return tuple of edit restricted templates. .. version-added:: 3.0 .. seealso:: :meth:`family.Family.get_edit_restricted_templates` :rtype: tuple[str, ...] .. method:: get_archived_page_templates() Return tuple of edit restricted templates. .. version-added:: 3.0 .. seealso:: :meth:`family.Family.get_archived_page_templates` :rtype: tuple[str, ...] .. method:: disambig(fallback = '_default') Return list of disambiguation templates. .. seealso:: :meth:`family.Family.disambig` :param str | None fallback: :rtype: list[str] .. method:: protocol() The protocol to use to connect to the site. May be overridden to return 'http'. Other protocols are not supported. .. version-changed:: 8.2 ``https`` is returned instead of ``http``. .. seealso:: :meth:`family.Family.protocol` :return: protocol that this family uses .. py:module:: site._apisite :synopsis: Objects representing API interface to MediaWiki site :mod:`APISite` --- API Interface for Sites ==================================================================== .. automodule:: pywikibot.site._apisite .. automodule:: pywikibot.site._extensions :synopsis: Objects representing API interface to MediaWiki site extensions .. automodule:: pywikibot.site._generators :synopsis: Objects representing API generators to MediaWiki site .. currentmodule:: pywikibot.site._generators .. method:: GeneratorsMixin.alllinks(start='', prefix='', namespace=0, unique=False, fromids=False, total=None) Iterate all links to pages (which need not exist) in one namespace. .. note:: In practice, links that were found on pages that have been deleted may not have been removed from the links table, so this method can return false positives. .. caution:: *unique* parameter is no longer supported by MediaWiki 1.43 or higher. Pywikibot uses :func:`tools.itertools.filter_unique` in that case which might be memory intensive. Use it with care. .. important:: Using *namespace* option different from ``0`` needs a lot of time on Wikidata site. .. version-deprecated:: 10.7 This method is dysfunctional and should no longer be used. It will be removed in Pywikibot 11. .. version-removed:: 11.0 This method was dysfunctional and removed, see the following tickets for details: :phab:`T359427`, :phab:`T364617` and :phab:`T407708` .. seealso:: - :api:`Alllinks` - :meth:`pagebacklinks` - :meth:`pagelinks` :param start: Start at this title (page need not exist). :param prefix: Only yield pages starting with this string. :param namespace: Iterate pages from this (single) namespace :param unique: If True, only iterate each link title once (default: False) :param fromids: if True, include the pageid of the page containing each link (default: False) as the '_fromid' attribute of the Page; cannot be combined with *unique* :param total: Limit the total number of items :raises KeyError: the *namespace* identifier was not resolved :raises TypeError: the *namespace* identifier has an inappropriate type such as bool, or an iterable with more than one namespace :rtype: Generator[pywikibot.Page] :mod:`DataSite` --- API Interface for Wikibase ========================================================================= .. py:module:: site._datasite :synopsis: Objects representing API interface to Wikibase site .. automodule:: pywikibot.site._datasite :mod:`Obsolete Sites` --- Outdated Sites ======================================================================= .. py:module:: site._obsoletesites :synopsis: Objects representing obsolete MediaWiki sites .. automodule:: pywikibot.site._obsoletesites :mod:`Siteinfo` --- Site Info Container ================================================================= .. py:module:: site._siteinfo :synopsis: Objects representing site info data contents .. automodule:: pywikibot.site._siteinfo :mod:`Namespace` --- Namespace Object ================================================================ .. py:module:: site._namespace :synopsis: Objects representing Namespaces of MediaWiki site .. automodule:: pywikibot.site._namespace :mod:`TokenWallet` --- Token Wallet ================================================================ .. py:module:: site._tokenwallet :synopsis: Objects representing api tokens .. automodule:: pywikibot.site._tokenwallet :mod:`Uploader` --- Uploader Interface ============================================================== .. py:module:: site._upload :synopsis: Objects representing API upload to MediaWiki site .. automodule:: pywikibot.site._upload