Pywikibot is short for '''Python MediaWiki Robot Framework'''. Pywikibot is a collection of tools made to fit the maintenance need on Wikipedia, but it can also be used on other MediaWiki sites. The Pywikibot interfaces with the '[https://www.mediawiki.org/wiki/API:Main_page MediaWiki API]'. There are a number of [https://www.mediawiki.org/wiki/Category:Pywikibot_scripts scripts already written] ([[wp:Manual:Pywikibot/Scripts]]) that you can use or modify to suit your needs.
View the [https://git.wikimedia.org/tree/pywikibot%2Fcore.git git repository] (core) to look at the code. (CF compat if needed). Here is an example, the