Manual:Pywikibot/Flow
Pywikibot includes basic support for Flow, the new discussion framework for Wikimedia wikis. This support will evolve over time as more features are added.
Examples
editDetermining if a page is a Flow board
editimport pwb # only needed if you haven't installed the framework as side-package
import pywikibot
import pywikibot.flow
site = pywikibot.Site('mediawiki', 'mediawiki')
page = pywikibot.Page(site, 'Talk:Sandbox')
if page.is_flow_page():
board = pywikibot.flow.Board(page)
Loading topic titles
editimport pwb # only needed if you haven't installed the framework as side-package
import pywikibot
import pywikibot.flow
site = pywikibot.Site('mediawiki', 'mediawiki')
board = pywikibot.flow.Board(site, 'Talk:Sandbox')
topic_titles = []
for topic in board.topics():
topic_titles.append(topic.root.get())
Creating new topics
editimport pwb # only needed if you haven't installed the framework as side-package
import pywikibot
import pywikibot.flow
site = pywikibot.Site('mediawiki', 'mediawiki')
board = pywikibot.flow.Board(site, 'Talk:Sandbox')
title = 'New topic'
content = 'This is a new topic.'
topic = board.new_topic(title, content)
Replying to topics
editimport pwb # only needed if you haven't installed the framework as side-package
import pywikibot
import pywikibot.flow
site = pywikibot.Site('mediawiki', 'mediawiki')
board = pywikibot.flow.Topic(site, 'Topic:whatever')
content = 'This is a new reply.'
reply = topic.reply(content)
- If you need more help on setting up your Pywikibot visit the #pywikibot IRC channel connect or pywikibot@ mailing list.