This is an old revision of the document!
Pywikibot
Perform all operations inside the pywikibot repository directory once cloned.
Fetch
git clone --recursive https://github.com/wikimedia/pywikibot cd pywikibot
Install
python3 -m venv ~/.venvs/pywikibot ~/.venvs/pywikibot/bin/python -m pip install -r requirements.txt
Config
First create a family file.
~/.venvs/pywikibot/bin/python pwb.py generate_family_file.py
Enter the URL and name to create a family file for the private site. Select no when asked about interwiki links.
Next a user configuration is needed.
cp user-config.py.sample user-config.py vi user-config.py
Eg.
mylang = 'en-gb' family = 'MySite' usernames['MySite']['en-gb'] = 'Mybot'
Lastly run the login script to enter the password.
~/.venvs/pywikibot/bin/python pwb.py login -v -v
Examples
~/.venvs/pywikibot/bin/python pwb.py <script_name>