Creating the parser

In order to run our code for the first time, we need to create a parser. We can quickly create a parser to run our code and check whether the values are being parsed properly.

Let's go ahead and create a file called weather_com_parser.py in the weatherterm/parsers directory. To make it simple, we are going to create just the necessary methods, and the only thing we are going to do when the methods are invoked is to raise a NotImplementedError:

from weatherterm.core import ForecastTypeclass WeatherComParser:    def __init__(self):        self._forecast = {            ForecastType.TODAY: self._today_forecast,            ForecastType.FIVEDAYS: self._five_and_ten_days_forecast,            ForecastType.TENDAYS: self._five_and_ten_days_forecast, ForecastType.WEEKEND: ...

Get Python Programming Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.