Difference between revisions of "Pywikibot"

From Freephile Wiki
Jump to navigation Jump to search
m (added Category:Python using HotCat)
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
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.  There are a number of [https://www.mediawiki.org/wiki/Category:Pywikibot_scripts scripts already written] that you can use or modify to suit your needs.
+
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 git repository to look at the code.  https://git.wikimedia.org/tree/pywikibot%2Fcore.git
+
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
 +
[https://git.wikimedia.org/blob/pywikibot%2Fcore.git/75397bd7ec25bc14d38b727e8c9e90477eda0f22/scripts%2Fbasic.py Basic.py]
 +
 
 +
The Pywikibot is similar in function to the "[https://git.wikimedia.org/blob/mediawiki%2Fcore.git/0bb3d2a499a37c348eab1df11a6229a2aa19ecf8/maintenance%2FREADME maintenance]" directory of core; except that it's written in Python rather than PHP, and the latter interacts directly with the software rather then through it's API.  So, if you just want a script-o-matic way of editing an article on your wiki, you can use [https://git.wikimedia.org/blob/mediawiki%2Fcore.git/0bb3d2a499a37c348eab1df11a6229a2aa19ecf8/maintenance%2Fedit.php edit.php].  However, if you want to do something that is not already present in the 'maintenance' directory, then it probably makes sense to search the Pywikibot code and/or write a new Pywikibot because the API is more stable than direct interaction/extension of core.
  
 
[[Category:Wiki]]
 
[[Category:Wiki]]
 
[[Category:Python]]
 
[[Category:Python]]

Latest revision as of 16:18, 17 June 2014

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 'MediaWiki API'. There are a number of scripts already written (wp:Manual:Pywikibot/Scripts) that you can use or modify to suit your needs.

View the git repository (core) to look at the code. (CF compat if needed). Here is an example, the Basic.py

The Pywikibot is similar in function to the "maintenance" directory of core; except that it's written in Python rather than PHP, and the latter interacts directly with the software rather then through it's API. So, if you just want a script-o-matic way of editing an article on your wiki, you can use edit.php. However, if you want to do something that is not already present in the 'maintenance' directory, then it probably makes sense to search the Pywikibot code and/or write a new Pywikibot because the API is more stable than direct interaction/extension of core.