Community Data Science Course (Spring 2023)/Week 5 lecture notes
From CommunityData
New concepts for the day:
- Defining functions
import json
andjson.loads()
andjson.dumps()
- Reading *from* files
- Breaking projects in multiple notebooks and step
- Waiting...
Stage 0: Coming up with a plan
- I'm going to split work into two steps, one is basically
Stage 1: Getting data
I want to build data on how popular something is using the MediaWiki views API. First I went searching I found two places:
I chose the second option.
The documentation suggested I should set up a unique user-agent. Search how todo that brought me to this StackOverflow post: https://stackoverflow.com/questions/10606133/sending-user-agent-using-requests-library-in-python which I followed to set up headers appropriately.
Between that and the interactive material in Wikimedia Rest API, I was able to construct a URL.