-
Notifications
You must be signed in to change notification settings - Fork 0
Description
Is your feature request related to a problem? Please describe.
While not strictly a problem, being able to display the current 5-day forecast is a staple feature in any weather checking program, in my opinion. OpenWeatherMap API provides this data -- utilize it!
Describe the solution you'd like
The forecast mode will be a separate top-level command from current. This will effectively split our operating modes in two so that each is contained separately. The OpenWeatherMap data provides 5-days worth of forecast data, at 3 hour intervals. Determine a pretty-print format, possibly with the calendar module, so that we can properly display that data. We may instead want to use a more generic table-formatting module if calendar feels limiting or does not allow us the proper control over formatting.
The end result should be the ability for the user to query a location for the 5-day forecast, with the same set of options as current would take for controlling which data to display. Output should be nicely formatted into a table, or similar structure so that it is easy to read. Ideally we want to fit our table width into a single standard terminal screen of 80x25 columns such that there should be no line breaks or broken formatting under normal circumstances.
Describe alternatives you've considered
One potential alternative is a strictly text based forecast display. Where instead of a table, you get small paragraphs or blurbs for each day in the forecast. I don't think this would translate well into final output. There would be far more data than can easily be scanned with the eye when you include 5-days at 3 hour intervals.
Additional context
The data returned by OpenWeatherMap will include a list with numbered elements for each 3-hour block. The number is cumulative as it is simply a list index, not a prediction number for each day. Therefore instead of grabbing the temperature as weather['main']['temp'], we would grab the temperature as weather[XX]['main']['temp'], where XX can be represented by day_number * hour_offset. That probably doesn't make total sense. Play with the data a bit in the REPL to help visualize how it is laid out before starting to implement our output loops.