Help:Toolforge/My first Pywikibot tool
| This page is currently a draft.
More information and discussion about changes to this draft on the talk page.
Create your Pywikibot Tool account
In addition to your own Tool Labs account, you also need to create a Tool acoount for your Pywikibot tool.
- Navigate to the Tools home page.
- Click Create a New Tool under Develop your own tool.
- Enter a Service group name. The Service group name will become the name of your tool account.
Do not prefix your service group name with
tools.. This prefix will cause an improperly created account. The management interface automatically adds this prefix where appropriate.
Note: If you only recently received access to the tools project, you may get an error about appropriate credentials. Log out of Wikitech and back in to fix the issue.
Within a minute or two, Tool Labs creates the Tool account and grants you access. If you were logged in through SSH when you created the Tool account, you must log off and log in again
Access your Pywikibot tool
After you create your Pywikibot's tool account, you can log into your tool project with SSH.
$ ssh <shell name>@login.tools.wmflabs.org
Switch to your tool account:
maintainer@tools-bastion:~$ become <toolname> tools.<toolname>@tools-bastion:~$
Now, you can install Pywikibot.
Using your tool account, do the following:
- Use git to download Pywikibot:
git clone --recursive https://gerrit.wikimedia.org/r/pywikibot/core.git pywikibot-core cd pywikibot-core
Set up your bot for selected wikis by running:
Choose a license
Pywikibot comes with an MIT LICENSE file. Make sure to choose a license for your tool early on. Also see, Help:Tool_Labs/Developing#Licensing_your_source_code
Publish your source code
Add documentation page for your tool
Set up a webpage for your tool
You can add webpage for your tool under http://tools.wmflabs.org/TOOLNAME. For example, http://tools.wmflabs.org/my-first-pywikibot-tool. Once you set up a webpage for your tool, the Tool list will link to it.
To set up webpage for you tool:
- Log in with your Tool account.
- Create a ~/public_html directory.
- Create ~/public_html/index.html.
- Start the web service:
$ webservice start