panodata / dwdweather2

Python client to access weather data from Deutscher Wetterdienst (DWD), the federal meteorological service in Germany.
https://community.panodata.org/t/dwdweather2-a-python-client-to-access-weather-data-from-deutscher-wetterdienst-dwd/98
MIT License
72 stars 13 forks source link

DwdWeather.query() doesn't returns a dictionary because 3 arguments are required #30

Open bsledev opened 4 years ago

bsledev commented 4 years ago

When using print(DwdWeather.query()) it only returns this message: TypeError: query() missing 3 required positional arguments: 'self', 'station_id', and 'timestamp' and not the expected list of all the possible keys.

I used Python 3.8.5 and the latest dwdweather2 release.

amotl commented 4 years ago

Dear Pnem,

the signature of DwdWeather.query() is

def query(self, station_id, timestamp, recursion=0):
    """
    Get values from cache.
    station_id: Numeric station ID
    timestamp: datetime object
    """

See also dwdweather/core.py#L533-L538.

However, I strongly recommend to move on to the Wetterdienst package. It is the successor library to dwdweather and dwdweather2 and is becoming more and more popular these days. We have been trying to get this en par with all the features offered by dwdweather2 and we have come pretty far these days. Enjoy!

With kind regards, Andreas.

cc @gutzbenj