Code to run the Python MediaWiki bot.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
jenkins-bot 36d21af5a0 Merge "[IMPR] Improvements for askForHints (3)" 7 months ago
docs [doc] Prepare next release 10 months ago
pywikibot Merge "[tests] Use assert_valid_iter_params for Site.blocks()" 7 months ago
scripts Merge "[IMPR] Improvements for askForHints (3)" 7 months ago
tests Merge "[tests] Use assert_valid_iter_params for Site.blocks()" 7 months ago
.appveyor.yml Merge "[tests] Remove 32-bit-tests for Python 2.7.4 and 3.4.1" 10 months ago
.codeclimate.yml [tests] Fix similar code checking in codeclimate 1 year ago
.codecov.yml [tests] remove botirc.py from coverage 1 year ago
.coveragerc Add .coveragerc and codecov.yml 4 years ago
.gitignore Add .vscode in .gitignore 1 year 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 1 year ago
CODE_OF_CONDUCT.rst [doc] use reStructuredText instead of markdown 2 years ago
CONTENT.rst [cleanup] Remove deprecated ez_setup.py 1 year ago
CREDITS [bugfix] Remove link to /edithistory from page's edithistory summary. 1 year ago
ChangeLog Update ChangeLog for release 3.0.20170713 2 years ago
Dockerfile Install dev-requirements.txt into Docker image 4 years ago
HISTORY.rst [doc] Update HISTORY.rst 8 months ago
LICENSE [doc] Update licence 1 year ago
README-conversion.txt [cleanup] Nothing left to do for a deprecated method 10 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 9 months ago
generate_family_file.py [cleanup] Simpliy generate_family_file.getlangs 1 year ago
generate_user_files.py [PY3] Make Python 2 more Python 3 compatible 10 months ago
pwb.py Merge "[IMPR] Enable global args with pwb.py script" 9 months ago
requests-requirements.txt [IMPR] Reduce deprecated stuff in requests-requirements.txt 11 months ago
requirements.txt Merge "[bugfix] Drop botirc.py library part" 1 year ago
setup.py [tests] Add 'eventstreams' requirement to test_deps 8 months ago
tox.ini Merge "[cleanup] Put fandom defaults into FandomFamily" 8 months ago
user-config.py.sample [doc] remove duplicate spaces inside doc strings 3 years ago
user-fixes.py.sample Import unicode_literals in user-fixes.py.sample 3 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 <https://www.mediawiki.org/wiki/API:Main_page>`_
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 <https://doc.wikimedia.org/pywikibot/>`_.

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 <https://www.mediawiki.org/wiki/Manual:Pywikibot/Installation>`_
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 <https://doc.wikimedia.org/pywikibot/>`_.

.. 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 <https://gerrit.wikimedia.org/>`_,
`learn <https://www.mediawiki.org/wiki/Developer_access>`_ how to get
started.

.. include:: CODE_OF_CONDUCT.rst