Code to run the Python MediaWiki bot.
jenkins-bot 36d21af5a0 Merge "[IMPR] Improvements for askForHints (3)" 2 weeks ago
docs [doc] Prepare next release 3 months ago
pywikibot Merge "[tests] Use assert_valid_iter_params for Site.blocks()" 2 weeks ago
scripts [IMPR] Improvements for askForHints (3) 2 weeks ago
tests Merge "[cleanup] Skip test classes as a whole" 3 weeks ago
.appveyor.yml Merge "[tests] Remove 32-bit-tests for Python 2.7.4 and 3.4.1" 3 months ago
.codeclimate.yml [tests] Fix similar code checking in codeclimate 4 months ago
.codecov.yml [tests] remove botirc.py from coverage 5 months ago
.coveragerc Add .coveragerc and codecov.yml 3 years ago
.gitignore Add .vscode in .gitignore 11 months ago
.gitmodules Fix url for .gitmodules 2 years ago
.gitreview Add .gitreview file for git migration 6 years ago
.svnprops update .svnprops 4 years ago
.travis.yml [tests] Update Travis tests configuration 5 months ago
CODE_OF_CONDUCT.rst [doc] use reStructuredText instead of markdown 1 year ago
CONTENT.rst [cleanup] Remove deprecated ez_setup.py 7 months ago
CREDITS [bugfix] Remove link to /edithistory from page's edithistory summary. 5 months ago
ChangeLog Update ChangeLog for release 3.0.20170713 2 years ago
Dockerfile Install dev-requirements.txt into Docker image 3 years ago
HISTORY.rst [doc] Update HISTORY.rst 3 weeks ago
LICENSE [doc] Update licence 8 months ago
README-conversion.txt [cleanup] Nothing left to do for a deprecated method 2 months ago
README.rst [doc] Add Python version shield to README.rst 1 year ago
dev-requirements.txt [lib] werkzeug 0.15.5 was published 1 month ago
generate_family_file.py [cleanup] Simpliy generate_family_file.getlangs 5 months ago
generate_user_files.py [PY3] Make Python 2 more Python 3 compatible 2 months ago
pwb.py Merge "[IMPR] Enable global args with pwb.py script" 1 month ago
requests-requirements.txt [IMPR] Reduce deprecated stuff in requests-requirements.txt 4 months ago
requirements.txt Merge "[bugfix] Drop botirc.py library part" 5 months ago
setup.py [tests] Add 'eventstreams' requirement to test_deps 1 month ago
tox.ini Merge "[cleanup] Put fandom defaults into FandomFamily" 1 month ago
user-config.py.sample [doc] remove duplicate spaces inside doc strings 2 years ago
user-fixes.py.sample Import unicode_literals in user-fixes.py.sample 2 years ago

README.rst

.. image:: https://travis-ci.org/wikimedia/pywikibot.svg?branch=master
:alt: Travis Build Status
:target: https://travis-ci.org/wikimedia/pywikibot
.. image:: https://img.shields.io/appveyor/ci/ladsgroup/pywikibot-g4xqx/master.svg?style=flat-square&label=AppVeyor%20CI
:alt: AppVeyor Build Status
:target: https://ci.appveyor.com/project/ladsgroup/pywikibot-g4xqx
.. image:: https://codecov.io/gh/wikimedia/pywikibot/branch/master/graph/badge.svg
:alt: Code coverage
:target: https://codecov.io/gh/wikimedia/pywikibot
.. image:: https://api.codeclimate.com/v1/badges/de6ca4c66e7c7bee4156/maintainability
:alt: Maintainability
:target: https://codeclimate.com/github/wikimedia/pywikibot/maintainability
.. image:: https://img.shields.io/pypi/pyversions/pywikibot.svg
:alt: Python
:target: https://www.python.org/downloads/
.. image:: https://img.shields.io/pypi/v/pywikibot.svg
:alt: Pywikibot release
:target: https://pypi.org/project/pywikibot/

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 -U setuptools
pip install pywikibot

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 `_.

.. include:: pywikibot/DIRECTORIES.rst

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

It may require the following programs to function properly:

* `7za`: To extract 7z files

.. include:: HISTORY.rst

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

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

.. include:: CODE_OF_CONDUCT.rst