Welcome to IClinic-Weather’s documentation!¶
Contents:
This module contains functions to solve the challenge proposed by iClinic.
-
iclinic_wea.
handler_err
(resp)[source]¶ Handler request error.
- resp: http.client.HTTPResponse
- Response of request
value: byte
-
iclinic_wea.
req
(service, params, timeout=10)[source]¶ Request function.
- service: str
- The name of the service provided by the API
- params: dict
- The params of api
- timeout: float, optional
- The request timeout
resp: dict
>>> params = {'q': 'Ribeirão Preto', 'appid': 'API KEY'} >>> resp = req("forecast", params=params, timeout=15)
-
iclinic_wea.
umbrella
(args)[source]¶ Checking if take an umbrella.
args: dict
>>> _args = {'city': 'Ribeirão Preto', 'appid': 'API KEY', 'limit': 70, 'timeout': 10} >>> umbrella(_args) You should take an umbrella in these days: Tuesday and Wednesday.
-
iclinic_wea.
ut2weekday
(unixtimestamp)[source]¶ Return weekday name based on unix time.
- unixtimestamp: int
- Unix timestamp
resp: string