SlideShare a Scribd company logo
Wikipedia: the encyclopedia
anyone can edit…
even with Python
Miguel-Angel Monjas
mmonjas@gmail.com
miguelangelmonjas@wikimedia.es
Meetup Python Madrid, ICAI-ICADE, 2018-04-12
About me
Miguel-Angel Monjas:
● Telecom engineer, data scientist,
innovation coach… in Ericsson Spain
● Proud wikipedian since December 2004
● Member of Wikimedia Spain (wikimedia.es)
Author’s portrait © 2016-2018 Miguel-Angel Monjas
@mmonjaspro
http://www.linkedin.com/in/mmonjas
https://github.com/miguel-angel-monjas/
2
Wikipedia?
Old stuff but…
3
Pages
5
Pages:
history
6
Pages:
Wikitext
7
Pages:
Wikitext
8
Categories
9
Users
10
Users
11
Images
12
Images
13
Images
14
Images
15
Sites
16
Wikidata
Items
17
A Python bot framework:
pywikibot
Concepts and how-to
18
Bots:
A definition
A bot is a software application
that performs automated tasks.
Typically, bots perform tasks
that are both simple and
structurally repetitive, at a
much higher rate than would
be possible for a human alone.
In the Wikimedia projects, a
bot is any software application
that modifies any element of
the project, by uploading
pictures, updating a page…
either massively or not
19
pywikibot
● Python library and
collection of tools that
automate work on
MediaWiki sites.
● https://www.mediawiki.org/
wiki/Manual:Pywikibot
● https://doc.wikimedia.org/p
ywikibot/api_ref/pywikibot.
html
20
pywikibot: Site
21
pywikibot: Page
22
pywikibot: Page
23
pywikibot: Page
24
pywikibot: Page
25
pywikibot: Page
26
pywikibot: FilePage
27
pywikibot: FilePage
28
pywikibot: FilePage
29
30
pywikibot: Category
31
pywikibot: Category
pywikibot: User
32
Editing in Wikipedia
33
Editing in Wikipedia
34
35
Editing in Wikipedia
36
37
MediaWiki API
Another way to interact with the projects
38
The
MediaWiki API
● The MediaWiki API is a web
service that provides access
to wiki features, data, and
meta-data over HTTP, via a
URL usually at api.php
● https://www.mediawiki.org
/wiki/API:Main_page
● https://www.mediawiki.org
/wiki/API:FAQ
39
URL elements
https://commons.wikimedia.org/w/api.php ?
action=query &
format=json &
titles=File:Madrid - Puerta Alcala 01.jpg &
prop=globalusage &
guprop=url|namespace &
gulimit=500
END POINT
ACTION FORMAT
QUERY-SPECIFIC
PARAMETERS
METHOD: POST
40
QUERY TYPE
41
42
IMAGE TITLE
PAGE
NAME SPACE
PROJECT
43
Extension:Kartographer
Maps capabilities in Wikimedia projects
44
Extension:
Kartographer
● A MediaWiki extension that
adds maps capabilities to
Wikimedia projects
● https://www.mediawiki.org/
wiki/Help:Extension:Kartogr
apher
● Based on OpenStreetMap
● Enabled by the <mapframe>
tag within Wikimedia pages
● Content must be valid
GeoJSON
(http://geojson.org/)
45
46
IMAGE
POINT
LINK
47
TAG
MAP CENTER
Wikitext
MAP SIZE
48
FEATURE TYPE: POINT
COORDINATES
IMAGE
LINKMARKER FEATURES
GeoJSON
49
MARKER
PAWS (Pywikibot: A Web Server)
Local Pywikibot deployment not needed
any more
50
● PAWS is a Jupyter Notebook
Server provided by the
Wikimedia Cloud Services.
● Pre-integrated with Pywikibot
and many other Python
packages
● pip, Git available…
● Authenticated (OAuth) with
your Wikimedia account.
● https://paws.wmflabs.org
● http://paws-
public.wmflabs.org/paws-
public/User:YOURUSERNAME/
51
52
53
54
55
56
57
58
The home directory (minus
secret credential files) is public
by default
59
Attribution-ShareAlike 4.0
(CC BY-SA 4.0)
Except where otherwise noted, this work by Miguel-Angel Monjas is licensed under
https://creativecommons.org/licenses/by-sa/4.0/
60
Thank you!
mmonjas@gmail.com
miguelangelmonjas@wikimedia.es
61

More Related Content

Similar to Python Madrid: Wikipedia, the encyclopedia anyone can edit... even with Python

The Social Semantic Web
The Social Semantic WebThe Social Semantic Web
The Social Semantic Web
John Breslin
 
Global Open Source Development 2011-2014 Review and 2015 Forecast
Global Open Source Development 2011-2014 Review and 2015 ForecastGlobal Open Source Development 2011-2014 Review and 2015 Forecast
Global Open Source Development 2011-2014 Review and 2015 Forecast
Sammy Fung
 
Charla Grasia: A framework for building distributed social network websites
Charla Grasia: A framework for building distributed social network websitesCharla Grasia: A framework for building distributed social network websites
Charla Grasia: A framework for building distributed social network websitesatapiador
 
Introduction to RFX for Backend Developer
Introduction to RFX for Backend DeveloperIntroduction to RFX for Backend Developer
Introduction to RFX for Backend Developer
Trieu Nguyen
 
JIO and WebViewers: interoperability for Javascript and Web Applications
JIO and WebViewers: interoperability  for Javascript and Web ApplicationsJIO and WebViewers: interoperability  for Javascript and Web Applications
JIO and WebViewers: interoperability for Javascript and Web Applications
XWiki
 
Knowledge Extraction for the Web of Things (KE4WoT) Challenge: Co-located wit...
Knowledge Extraction for the Web of Things (KE4WoT) Challenge: Co-located wit...Knowledge Extraction for the Web of Things (KE4WoT) Challenge: Co-located wit...
Knowledge Extraction for the Web of Things (KE4WoT) Challenge: Co-located wit...
Amélie Gyrard
 
Exploiting Wikipedia for Information Retrieval Tasks, SIGIR Tutorial
Exploiting Wikipedia for Information Retrieval Tasks, SIGIR TutorialExploiting Wikipedia for Information Retrieval Tasks, SIGIR Tutorial
Exploiting Wikipedia for Information Retrieval Tasks, SIGIR Tutorial
Victor Makarenkov
 
Contributions to an open source project: Igalia and the Chromium project
Contributions to an open source project: Igalia and the Chromium projectContributions to an open source project: Igalia and the Chromium project
Contributions to an open source project: Igalia and the Chromium project
Igalia
 
Wirecloud hamburg kickoff
Wirecloud hamburg kickoffWirecloud hamburg kickoff
Wirecloud hamburg kickoff
Miguel Jiménez
 
The OpenEuropa Initiative
The OpenEuropa InitiativeThe OpenEuropa Initiative
The OpenEuropa Initiative
Nuvole
 
Magnolia CMS and the IoT
Magnolia CMS and the IoTMagnolia CMS and the IoT
Magnolia CMS and the IoT
mycontainer
 
Magnolia and the IOT
Magnolia and the IOTMagnolia and the IOT
Magnolia and the IOT
Magnolia
 
Combining Machine Learning with Physical Computing - June 2023
Combining Machine Learning with Physical Computing - June 2023Combining Machine Learning with Physical Computing - June 2023
Combining Machine Learning with Physical Computing - June 2023
Hal Speed
 
Shockingly Fast Site Development with Acquia Lightning 4.0
Shockingly Fast Site Development with Acquia Lightning 4.0Shockingly Fast Site Development with Acquia Lightning 4.0
Shockingly Fast Site Development with Acquia Lightning 4.0
Rachel Wandishin
 
WikiLoop: Big tech's Open Knowledge contributions
WikiLoop: Big tech's Open Knowledge contributionsWikiLoop: Big tech's Open Knowledge contributions
WikiLoop: Big tech's Open Knowledge contributions
All Things Open
 
Web 2.0: a course
Web 2.0: a courseWeb 2.0: a course
Web 2.0: a course
Carlo Vaccari
 
Dissmark Ii Social Software
Dissmark Ii Social SoftwareDissmark Ii Social Software
Dissmark Ii Social Software
davidroethler
 
Digital Tools for Manuscript Study IIIF
Digital Tools for Manuscript Study IIIFDigital Tools for Manuscript Study IIIF
Digital Tools for Manuscript Study IIIF
Rachel Di Cresce
 
Open Source Social Software
Open Source Social SoftwareOpen Source Social Software
Open Source Social SoftwareJosie Fraser
 
Geoportal4everybody
Geoportal4everybodyGeoportal4everybody
Geoportal4everybody
Karel Charvat
 

Similar to Python Madrid: Wikipedia, the encyclopedia anyone can edit... even with Python (20)

The Social Semantic Web
The Social Semantic WebThe Social Semantic Web
The Social Semantic Web
 
Global Open Source Development 2011-2014 Review and 2015 Forecast
Global Open Source Development 2011-2014 Review and 2015 ForecastGlobal Open Source Development 2011-2014 Review and 2015 Forecast
Global Open Source Development 2011-2014 Review and 2015 Forecast
 
Charla Grasia: A framework for building distributed social network websites
Charla Grasia: A framework for building distributed social network websitesCharla Grasia: A framework for building distributed social network websites
Charla Grasia: A framework for building distributed social network websites
 
Introduction to RFX for Backend Developer
Introduction to RFX for Backend DeveloperIntroduction to RFX for Backend Developer
Introduction to RFX for Backend Developer
 
JIO and WebViewers: interoperability for Javascript and Web Applications
JIO and WebViewers: interoperability  for Javascript and Web ApplicationsJIO and WebViewers: interoperability  for Javascript and Web Applications
JIO and WebViewers: interoperability for Javascript and Web Applications
 
Knowledge Extraction for the Web of Things (KE4WoT) Challenge: Co-located wit...
Knowledge Extraction for the Web of Things (KE4WoT) Challenge: Co-located wit...Knowledge Extraction for the Web of Things (KE4WoT) Challenge: Co-located wit...
Knowledge Extraction for the Web of Things (KE4WoT) Challenge: Co-located wit...
 
Exploiting Wikipedia for Information Retrieval Tasks, SIGIR Tutorial
Exploiting Wikipedia for Information Retrieval Tasks, SIGIR TutorialExploiting Wikipedia for Information Retrieval Tasks, SIGIR Tutorial
Exploiting Wikipedia for Information Retrieval Tasks, SIGIR Tutorial
 
Contributions to an open source project: Igalia and the Chromium project
Contributions to an open source project: Igalia and the Chromium projectContributions to an open source project: Igalia and the Chromium project
Contributions to an open source project: Igalia and the Chromium project
 
Wirecloud hamburg kickoff
Wirecloud hamburg kickoffWirecloud hamburg kickoff
Wirecloud hamburg kickoff
 
The OpenEuropa Initiative
The OpenEuropa InitiativeThe OpenEuropa Initiative
The OpenEuropa Initiative
 
Magnolia CMS and the IoT
Magnolia CMS and the IoTMagnolia CMS and the IoT
Magnolia CMS and the IoT
 
Magnolia and the IOT
Magnolia and the IOTMagnolia and the IOT
Magnolia and the IOT
 
Combining Machine Learning with Physical Computing - June 2023
Combining Machine Learning with Physical Computing - June 2023Combining Machine Learning with Physical Computing - June 2023
Combining Machine Learning with Physical Computing - June 2023
 
Shockingly Fast Site Development with Acquia Lightning 4.0
Shockingly Fast Site Development with Acquia Lightning 4.0Shockingly Fast Site Development with Acquia Lightning 4.0
Shockingly Fast Site Development with Acquia Lightning 4.0
 
WikiLoop: Big tech's Open Knowledge contributions
WikiLoop: Big tech's Open Knowledge contributionsWikiLoop: Big tech's Open Knowledge contributions
WikiLoop: Big tech's Open Knowledge contributions
 
Web 2.0: a course
Web 2.0: a courseWeb 2.0: a course
Web 2.0: a course
 
Dissmark Ii Social Software
Dissmark Ii Social SoftwareDissmark Ii Social Software
Dissmark Ii Social Software
 
Digital Tools for Manuscript Study IIIF
Digital Tools for Manuscript Study IIIFDigital Tools for Manuscript Study IIIF
Digital Tools for Manuscript Study IIIF
 
Open Source Social Software
Open Source Social SoftwareOpen Source Social Software
Open Source Social Software
 
Geoportal4everybody
Geoportal4everybodyGeoportal4everybody
Geoportal4everybody
 

Recently uploaded

Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
Elena Simperl
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Thierry Lestable
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
Product School
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
DianaGray10
 

Recently uploaded (20)

Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...When stars align: studies in data quality, knowledge graphs, and machine lear...
When stars align: studies in data quality, knowledge graphs, and machine lear...
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdfFIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
FIDO Alliance Osaka Seminar: Passkeys at Amazon.pdf
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
Empowering NextGen Mobility via Large Action Model Infrastructure (LAMI): pav...
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
De-mystifying Zero to One: Design Informed Techniques for Greenfield Innovati...
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 

Python Madrid: Wikipedia, the encyclopedia anyone can edit... even with Python