U
    ٠f                     @   s   d d Z dS )c               	   C   s8  dd l }dd l}ddlm} ddlm} ddlm}	 dd l}
dd l}ddlm} |d}z|	|ddi W n   t
|
  Y nX d	}|j|d
}d|  d| |dd}z|j||d}W n   i }Y nX z| }W n   i }d|_Y nX i }|jdkr4z
|d d }|d d d d }|d d d d d }z|d }W n   d}Y nX z|d }W n   d}Y nX z|d }W n   d}Y nX z|d }W n   d}Y nX z|d }W n   d}Y nX |dd||d|d  }|dd||d|d! }z|d" d# }W n   d}Y nX z|d$ d# }W n   d}Y nX |d krnt|t|k r|}|d krnt|t|kr|}||||||||d%}t
| |dd||d|| W n   t
|
  Y nX d S )&N    )credentials)db)	messaging)datezservicekey.jsondatabaseURLz,https://farmbase-b2f7e-31c0c.firebaseio.com/z)http://api.weatherapi.com/v1/history.jsonz%Y%m%dZdd6e11f5d20e4694bed72932241007,z%Y-%m-%d)keyqdt)params404locationnameZforecastZforecastdaydayhourcloudzNot Availablewind_degreeZwind_mphZpressure_mbhumidityPaidMonitoredFieldsPMFWeathermax_tempmin_tempZ	mintemp_ci  Z	maxtemp_c)cloud_coverwind_deg
wind_speedstationpressurer   r   r   )requestsfirebase_adminr   r   r   	tracebackdatetimer   Certificateinitialize_appprint
format_excstrptimestrftimegetjsonstatus_code	referencechildfloatset) ZlatZloncur_dateuidfieldidr   r   r   r   r   r    r!   r   credZAPI_URLcurrent_dater   respxweather_dataZstation_nameyzr   r   r   r   r   temp_max_temptemp_min_tempr   r    r;   0/home/ankuromar296_gmail_com/get_weather_data.pyget_weather_data   s    
 













r=   N)r=   r;   r;   r;   r<   <module>       