Welcome to IClinic-Weather’s documentation!


This module contains functions to solve the challenge proposed by iClinic.


Handler request error.

resp: http.client.HTTPResponse
Response of request

value: byte


Main function.

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)

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.

Return weekday name based on unix time.

unixtimestamp: int
Unix timestamp

resp: string


Validate if value is empty.

value: str
Command line value

value: str

>>> nvalue = val_fpos("hi")
>>> print("Value is: %s" % nvalue)
Value is hi

Validate if float is positive.

value: str
Command line value

value: float

>>> nvalue = val_fpos(15)
>>> print("Value is: %.2f" % nvalue)
Value is 15.00

Indices and tables