Tuesday, January 12, 2021

Genuary 2021 Day 12: "Use an API"

 


The prompt says "Use an API (e.g. the weather)". I could have cheesed this one by claiming that my use of any of the APIs to my libraries (e.g. drawSVG, Pillow) counted.

Instead, I used the Washington State Department of Transportation (WSDOT) Ferry Schedule REST API, which I feel was closer in line to what the intent of the prompt was.

I fetched the ferry routes, decoded the sailing times for 19 different ferry terminals. In some cases, I had both departure and arrival times, other times, I just had the departure time, so I assumed the crossing time was 30 minutes.

I manually sorted the cities to make things make the most sense (to me) - Bainbridge Island / Seattle / Bremerton are the first three lines, then Edmonds/Kingston. For some reason, I have no sailing data for today for Edmonds/Kingston. I know there was a logging truck that spilled some logs a few days ago:

https://www.seattletimes.com/seattle-news/transportation/log-spill-blocks-edmonds-ferry-dock-monday-afternoon/

This feels more like an infographic, or just a "graph" than a piece of art, though the shapes for the San Juan Island ferries (bottom of the image) are pretty nuts.



Tools Used
: DrawSVG, WSDOT REST API

Languages Used: Python3

Development Time: ~2 hours

Drawing Time: ~6 minutes

What's Generative Here: I pulled the sailing data and used that to generate lines in time between departure port and arrival port. Feels not very generative.











No comments:

Post a Comment