Skip to content
Hydriz Scholz edited this page Jun 12, 2015 · 1 revision

Database reports for the Simple English wikis

This repository hosts code that is used to generate database reports for the Simple English Wikipedia and the Simple English Wiktionary.

Running the bot

To run the bot on your own wiki, you will need to edit DBRCore.py with the necessary information for your wiki (such as the URL to the API). Note: This software is written in the context of the Wikimedia Labs (which has the "_p" suffix). Following that, you can use the dbr.py script to run the database reports (which are all stored in the reports folder).

Command for running a database report:

python dbr.py <database> <report>

Where:

  • <database> is the name of the database that you intend to query (e.g. "simplewiki", "simplewiktionary, etc.)
  • <report> is the name of the report that you intend to generate (e.g. "wantedpages", "mostinvokes", etc.)

Patches

Patches are always welcome. Simply fork this project, make your commits and send a pull request. Here are some tips to help you get started on this project:

  • DBRCore.py is a module that contains code that is used by multiple reports (hence is the "core" of the project).
  • dbr.py is the script that people use to run database reports. This script is necessary so that DBRCore.py can be invoked correctly in the reports modules.
  • The reports folder contains the various database reports, useful if you are fixing an existing report or producing a new one.

Producing a new report

Here are some of the steps necessary to produce a new report:

  1. Give your report an identifier (e.g. "reportname"). This identifier is used by the bot owner to run the specific script.
  2. Name the python script with the identifier (e.g. "reportname.py") and add its entry into __init__.py in the reports directory.
  3. Inside this python script, start with the name of the class as "DBR" followed by the name of the identifier (e.g. "DBRreportname").
  4. Follow the function definition of __init__ that is available in other scripts.
  5. Have a function named "execute" with the code that you would execute when running the database report.

Links to the on-wiki database reports