A workshop for the Art of Data Visualization conference at Columbia University, 2016 and 2017. A project by Juan Francisco Saldarriaga ([email protected]).
- Intro to APIs
- Examples of things people do with APIs
- Why Python? Python 2.7 vs Python 3
- Open a Foursquare developer account
- Copy API key
- Python IDE:
- Mac:
- Terminal
- Atom
- Sublime Text
- Canopy
- Windows:
- Mac:
- Overview of process and possible outcome
- Talk about authorization process (token vs. 2 step OAuth)
- Functions
- Variables:
- Types of variables
- Operations between variables:
- Problems with combining certain kinds of variables together (ie. string + int or float)
- Global vs. local
- Comments
- Loops
- Indentation matters
- Conditionals
- Libraries
- Import library
- Build request (string)
- Submit request
- Get response
- JSON format
- Handling errors (try/catch)
- Import library
- Examine response
- Extract data from response
- Open file
- Reading data from file
- Building multiple requests with data
- Careful with API rate limits
- Creating new file
- Writing data to new file