meteostat.hourly
On this page
Get hourly weather data for a specific station or location.
- Type: Function
- Source Code: GitHub
Parameters#
| Parameter | Description | Data Type | Default Value |
|---|---|---|---|
station |
Weather station(s) or geographical point(s). | str, Station, Point, List[str], List[Station], List[Point], DataFrame |
Required |
start |
Start date of the desired period. | datetime, date or None |
None |
end |
End date of the desired period. | datetime, date or None |
None |
timezone |
Time zone of the period and records. If not set, UTC is used. | str or None |
None (UTC) |
parameters |
Requested meteorological parameters. | List[Parameter] |
Default parameters |
providers |
Requested data providers. | List[Provider] |
[Provider.HOURLY] |
Returns#
Example#
Python
# Import Meteostat library and dependencies
from datetime import datetime
import meteostat as ms
# Set time period
start = datetime(2018, 1, 1)
end = datetime(2018, 12, 31, 23, 59)
# Get hourly data
ts = ms.hourly(ms.Station(id='72219'), start, end)
df = ts.fetch()
# Print DataFrame
print(df)