Code to run the Python MediaWiki bot.

xqt 306d463b8e [PEP8] Keep lines beneath 80 chars 5 months ago
docs cc8693317d Add copyright to several scripts 1 year ago
pywikibot 45a2759aae Merge "site_detect.py: Detect database error from reponse.content" 5 months ago
scripts 306d463b8e [PEP8] Keep lines beneath 80 chars 5 months ago
tests 2b28f61433 Merge "Make WbTime from Timestamp and vice versa" 5 months ago
.appveyor.yml 51ef21f9ad Run codecov on CI job failure 1 year ago
.codecov.yml b9a21ba69d Add .coveragerc and codecov.yml 1 year ago
.coveragerc b9a21ba69d Add .coveragerc and codecov.yml 1 year ago
.gitattributes 188f157c29 improvement; add '.gitattributes' file in order to re-enable some $Id$ support (from compat) 4 years ago
.gitignore 40fcb9d374 Add `.cache` to .gitignore 9 months ago
.gitmodules a9327c19be i18n: always follow master 2 years ago
.gitreview 04347feb13 Add .gitreview file for git migration 4 years ago
.svnprops 44111f5200 update .svnprops 2 years ago
.travis.yml 3155a95c65 Fix generating WMF Labs families 9 months ago
CREDITS 8beb9df68e Credit myself by real name 1 year ago
ChangeLog 38ad31a2db Release 2.0rc5 ChangeLog 1 year ago
Dockerfile 010fb01260 Install dev-requirements.txt into Docker image 1 year ago
LICENSE 63f66597a2 Update copyright string 7 months ago
README-conversion.txt e12f272c79 [compat2core] Add information about templatesWithParams 6 months ago
README.rst 67c726f2ff README.rst: Fixed typo 10 months ago
dev-requirements.txt 431e72083a Using pytest-httpbin 8 months ago
ez_setup.py 0d61588f22 Update ez_setup.py to v19.1.1 1 year ago
generate_family_file.py 3155a95c65 Fix generating WMF Labs families 9 months ago
generate_user_files.py 077522d29a Inform user when user-config.py already exists 5 months ago
pwb.py f8f8814932 Merge "[IMPR] Provide a private user script path to be used by pwb.py" 9 months ago
requests-requirements.txt ecc1fdc77a Update security requirements of requests 6 months ago
requirements.txt e53c314885 Use Pillow<3.5.0 on python2.6 6 months ago
setup.py c67e06966a Allow date-versioned pypi releases from setup.py 5 months ago
tox.ini c67e06966a Allow date-versioned pypi releases from setup.py 5 months ago
user-config.py.sample f158b7bb84 [doc] remove duplicate spaces inside doc strings 10 months ago
user-fixes.py.sample 30d4d0ee0b Use single space in coding line 6 months ago

README.rst

Pywikibot
=========

The Pywikibot framework is a Python library that interfaces with the
`MediaWiki API `_
version 1.14 or higher.

Also included are various general function scripts that can be adapted for
different tasks.

For further information about the library excluding scripts see
the full `code documentation `_.

Quick start
-----------

::

git clone https://gerrit.wikimedia.org/r/pywikibot/core.git
cd core
git submodule update --init
python pwb.py script_name

Or to install using PyPI (excluding scripts)
::

pip install pywikibot --pre

Our `installation
guide `_
has more details for advanced usage.

Basic Usage
-----------

If you wish to write your own script it's very easy to get started:

::

import pywikibot
site = pywikibot.Site('en', 'wikipedia') # The site we want to run our bot on
page = pywikibot.Page(site, 'Wikipedia:Sandbox')
page.text = page.text.replace('foo', 'bar')
page.save('Replacing "foo" with "bar"') # Saves the page

-------------------------------------------------------------------------------------------

For more documentation on pywikibot see our `docs `_.


The contents of the package
----------------------------

+----------------------------------------------------------------------------------+
| README and config files: |
+===========================+======================================================+
| ChangeLog | Log file to keep track of major changes versionwise |
+---------------------------+------------------------------------------------------+
| CREDITS | List of major contributors to this module |
+---------------------------+------------------------------------------------------+
| ez_setup.py | Bootstrap distribute installation file, can also be |
| | run to install or upgrade setuptools. |
+---------------------------+------------------------------------------------------+
| generate_family_file.py| Creates a new family file. |
+---------------------------+------------------------------------------------------+
| generate_user_files.py | Creates user-config.py or user-fixes.py |
+---------------------------+------------------------------------------------------+
| LICENSE | a reference to the MIT license |
+---------------------------+------------------------------------------------------+
| pwb.py | Wrapper script to use Pywikibot in 'directory' mode |
+---------------------------+------------------------------------------------------+
| README-conversion.txt | Guide to converting bot scripts from version 1 |
| | of the Pywikibot framework to version 2 |
+---------------------------+------------------------------------------------------+
| README.rst | Short info string used by Pywikibot Nightlies |
+---------------------------+------------------------------------------------------+
| requirements.txt | PIP requirements file |
+---------------------------+------------------------------------------------------+
| setup.py | Installer script for Pywikibot 2.0 framework |
+---------------------------+------------------------------------------------------+
| user-config.py.sample | Example user-config.py file for reference |
+---------------------------+------------------------------------------------------+

+----------------------------------------------------------------------------------+
| Directories |
+===========================+======================================================+
| pywikibot | Contains some libraries and control files |
+---------------------------+------------------------------------------------------+
| scripts | Contains all bots and utility scripts |
+---------------------------+------------------------------------------------------+
| tests | Some test stuff for the developing team |
+---------------------------+------------------------------------------------------+


Required external programs
---------------------------

It may require the following programs to function properly:

* `7za`: To extract 7z files

Contributing
------------

Our code is maintained on Wikimedia's `Gerrit installation `_,
`learn `_ how to get
started.

.. image:: https://secure.travis-ci.org/wikimedia/pywikibot-core.png?branch=master
:alt: Build Status
:target: https://travis-ci.org/wikimedia/pywikibot-core