meteociel.forecasts.get_forecast_url
- meteociel.forecasts.get_forecast_url(*, city_name: str = '', city_id: str = '', mode: str = 'forecasts', model: str = 'gfs')
Search and return the correct url to get the requested forecasts data.
See also
The parameters are the same as for the
meteociel.forecasts.forecastfunction.Parameters
- city_name
str, keyword_only, optionnal By default:
"". The requested city name.- city_id
str, keyword_only, optionnal By default:
"". By passing directly the city id, the API will search by id rather than by name.- mode
str, keyword_only, optionnal By default:
"forecasts". There is two available modes:"forecasts"that provides data for the three days ahead;"trends"that provides data for the ten days ahead but with lower confidence.
- model
str, keyword_only, optionnal By default:
"gfs". The model from which the data are obtained.Note
The
modelparameter is only available in"forecasts"mode, otherwise it will ignored.
Returns
- out
str The url of the data.
Raises
- ConnectionError
Can be raised if the request fails.
- TooManyCitiesError
This exception is raised if the given city name match several cities.
Exemples
>>> from meteociel.forecasts import get_forecast_url >>> url = get_forecast_url(city_name="Toulouse 31000", mode="forecasts", model="gfs") >>> url https://www.meteociel.fr/previsions/10979/toulouse.htm
- city_name