In [1]:
import pywikibot
In [2]:
site = pywikibot.Site('test', 'wikipedia')
In [3]:
site
Out[3]:
APISite("test", "wikipedia")
In [4]:
page = pywikibot.Page(site, 'test')
In [5]:
page.exists()
Out[5]:
True
In [6]:
page.text
Out[6]:
'\n--[=[\nInital mappings taken from [[Template:Technique/WikidataLUT]]\nusing vim with substitution command\n":%s/|\\(.\\{-}\\)\\_s*= \\(Q\\d\\+\\).*$/[\'1\'] = \'2\',/g".\n\nThis is a page separate from [[Template:Technique/WikidataLUT]] because that\npage supplies Wikidata with Commons information via QuickStatements.\nSince this page is work in progress it is intended to unify them once this page\nhas reached a sufficiently stable state.\n\nPerhaps some can be taken from [[Module:Technique/mappings]].\n\nSee also [[Module:Artwork/Technique LUT]].\n]=]\n\nlocal p = {}\n\np.nouns = {\n\t[\'abalone\']              = {qid: \'Q190093\',   material: false, process: false, object: false, altQids: {}},\n\t[\'alder wood\']           = {qid: \'Q1355553\',  material: true,  process: false, object: false, altQids: {}},\n\t[\'wove paper\']           = {qid: \'Q21279007\', material: true,  process: false, object: true,  altQids: {}},\n\t[\'wrought iron\']         = {qid: \'Q860451\',   material: false, process: false, object: false, altQids: {}},\n\t[\'yew wood\']             = {qid: \'Q28942722\', material: true,  process: false, object: false, altQids: {}},\n\t[\'zinc\']                 = {qid: \'Q758\',      material: true,  process: false, object: false, altQids: {}},\n}\n\np.adjectives = {\n\t[\'black\'] = \'Q23445\',\n\t[\'blue\'] = \'Q1088\',\n}\n\nreturn p'
In [ ]: