/weather-forecast

A Python script that displays the 5-day weather forecast for a given location at 3 hour intervals. Locations can be searched by city name, postal code, or coordinates. This was implemented using the pyOWM API (Open Weather Map).

Primary LanguagePythonThe UnlicenseUnlicense

Weather-Forecast

Python Version License: Unlicense
Total alerts Language grade: Python Codacy Badge Maintainability

A Python script that displays the 5-day weather forecast (3 hour intervals) for a given location. This was implemented using the pyOWM API (Open Weather Map).

Locations can be searched by city name, postal code, or coordinates. Furthermore, after searching a given location, the forecast is printed to the console. After the forecast finishes, the user is prompted to search for another location. The script doesn't terminate until the user exits. Just before terminating, the forecasts for any search locations are dumped to a .csv file.

Requirements

Python

You need Python 3.4 or later to run this script. You can have multiple Python versions (2.x and 3.x) installed on the same system without issue.

In Ubuntu, Mint and Debian you can install Python 3 like this:

$ sudo apt-get install python3 python3-pip

For other Linux flavors, macOS and Windows, packages are available at https://www.python.org/getit/

PyOWM

Furthermore, you need the PyOWM wrapper library for OpenWeatherMap web APIs installed locally. The dependency can be installed through the pip installer like this:

$ pip install pyowm

Sample Output

sample

What I Learned

  • Python syntax
  • pip installer usage
  • Familiarity with APIs (API calls, response errors, data management, etc.)
  • Data structures and data management in Python
  • Command line management in Python
  • File IO operations in Python
  • Type hinting in Python
  • DRY principle (don't repeat yourself)

Tasks

  • Add coordinates support
  • Add support for other measurments such as humidity and visibility
  • Add toggle for units (metric vs imperial)