User:Cmglee/Wikimania 2016 notes
Appearance
Lua hackathon
[edit]My first Wikimania was in Script error: No such module "Wikimania"..
To upload and download files on Commons:
- http://mediawiki.org/wiki/Manual:Pywikibot/upload.py
- http://mediawiki.org/wiki/Manual:Pywikibot/data_ingestion.py
- http://mediawiki.org/wiki/Manual:Pywikibot/Installation
See Etherpad and talk to user:Yarl (referred by user:Masti)
Chat with Shyamal
[edit]- http://www.edwardtufte.com/bboard/q-and-a?topic_id=1
- http://www.species-in-pieces.com/
- Elephant in 4 points
- R readShapePoly save as EPS and import in Inkscape
pywikibot training
[edit]- Login to http://paws.wmflabs.org (hard refresh if connecting problem)
- New > Terminal
- Visit test.wikipedia.org to create account, then enter in Terminal
pwb.py add_text -up -talk -page:"user_talk:cmglee" -text:"Hello. ~~~~"
adds to http://test.wikipedia.org/wiki/user_talk:cmglee - To write to other wikipedias, create a file
user-config.py
with content
mylang = 'en' family = 'wikipedia'
- In a Python 3 Notebook, press shift+enter to execute command, tab for word completion, append ? and shift-enter for help on any command:
import pywikibot test_site = pywikibot.Site('test', 'wikipedia') test_page = pywikibot.Page(test_site, 'user_talk:cmglee') test_page.exists() test_page.text += 'Hello world' test_page.save()
- More: http://www.mediawiki.org/wiki/Manual:Pywikibot/Scripts
- To create HTML form GUI:
@interact_manual def write_page(name='user_talk:cmglee', text=): p = pywikibot.Page(test, name) p.text = text p.save()
Site |_ Page |_ ItemPage |_ Item dict |_ claim |_ claim
- Access wikidata
site = pywikibot.Site('wikidata', 'wikidata') repo = site.data_repository() item = pywikibot.ItemPage(repo, 'Q43049') item_dict = item.get() item_dict.keys() dir(item) claim = item_dict['claims']['P31'][0] dir(claim) claim.toJSON()
- deprecated = obsolete info but kept for interest e.g. medical claims