-
-
Notifications
You must be signed in to change notification settings - Fork 0
Home
This repository hosts code that is used to generate database reports for the Simple English Wikipedia and the Simple English Wiktionary.
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 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 thatDBRCore.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.
Here are some of the steps necessary to produce a new report:
- Give your report an identifier (e.g. "
reportname
"). This identifier is used by the bot owner to run the specific script. - Name the python script with the identifier (e.g. "
reportname.py
") and add its entry into__init__.py
in thereports
directory. - Inside this python script, start with the name of the class as "DBR" followed by the name of the identifier (e.g. "
DBRreportname
"). - Follow the function definition of
__init__
that is available in other scripts. - Have a function named "
execute
" with the code that you would execute when running the database report.