Editing Community Data Science Course (Spring 2023)/Week 6 lecture notes
From CommunityData
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
Three goals for today's lecture: | Three goals for today's lecture: | ||
# | # talk about projects | ||
# Walk through example code that grabs data from the MediaWiki API and introduces a small number of new concepts | # Walk through example code that grabs data from the MediaWiki API and introduces a small number of new concepts | ||
# | # walk through example code that grabs data from the Yelp API (and uses a module and authentication) | ||
== Final Projects == | == Final Projects == | ||
Your next major milestone is May 15 and it will be | Your next major milestone is May 15 and it will be a final Project proposal. I'm hoping that you have a clear description of your questions and a clear sense of how you are goint to get data to answer these. | ||
A few points to talk through | A few points to talk through: | ||
* What are the components of successful project proposal? (e.g., | * What are the components of successful project proposal? (e.g., dummy figures, etc) | ||
* A strong sense of whether your work is going to be doable. | * A strong sense of whether your work is going to be doable. | ||
* Class assignments will continue to shift toward project work. | * Class assignments will continue to shift toward project work. | ||
Line 23: | Line 19: | ||
Walk through some code and introduce some new concepts: | Walk through some code and introduce some new concepts: | ||
* | * MediaWiki: The software that runs many wikis including basicaly every website on Fandom.com | ||
* MediaWiki API with documentation in various places [https://www.mediawiki.org/wiki/API:Main_page] [https://en.wikipedia.org/w/api.php] | * MediaWiki API with documentation in various places [https://www.mediawiki.org/wiki/API:Main_page] [https://en.wikipedia.org/w/api.php] | ||
* Walk through some example code that I've written in | * Walk through some example code that I've written in this notebook {{forthcoming}} | ||
This introduces a few new concepts: | This introduces a few new concepts: | ||
* <code>while True</code> loops | * <code>while True</code> loops | ||
* | * continuations (i.e., what do you do when you dont' nkow how much data you have?) | ||
* <code>time.sleep()</code> | * <code>time.sleep()</code> | ||
Line 41: | Line 36: | ||
* Installing new Python modules with <code>%run pip install <PACKAGE></code> | * Installing new Python modules with <code>%run pip install <PACKAGE></code> | ||
The Yelp API is ''authenticated''. | The Yelp API is ''authenticated''. Authenticatino can come in one of several forms including: | ||
* keys that are embedded into your normal parameters (like <code>{'api-key' : 'SOMETHING'}</code>) | * keys that are embedded into your normal parameters (like <code>{'api-key' : 'SOMETHING'}</code>) | ||
Line 51: | Line 46: | ||
* creating a App ("''wait... I'm creating an app?!''") | * creating a App ("''wait... I'm creating an app?!''") | ||
Some things to keep in mind include: | Some things to keep in mind include: | ||
Line 61: | Line 55: | ||
Now lets end by walking through two examples: | Now lets end by walking through two examples: | ||
* | * Yelp eample notebook #1 {{forthcoming}} | ||
* | * Yelp example notebook #2 {{forthcoming}} |