Neurolingua commited on
Commit
a85a9a9
1 Parent(s): 528f451

Update other_function.py

Browse files
Files changed (1) hide show
  1. other_function.py +13 -1
other_function.py CHANGED
@@ -101,4 +101,16 @@ def get_weather(city):
101
  temperature=soup.find('div',attrs={'class':'BNeawe iBp4i AP7Wnd'}).text
102
  degree=temperature[:-2]
103
  celcius=str(round((int(degree) - 32)* 5/9,1))+temperature[-2]+'C'
104
- return (celcius)
 
 
 
 
 
 
 
 
 
 
 
 
 
101
  temperature=soup.find('div',attrs={'class':'BNeawe iBp4i AP7Wnd'}).text
102
  degree=temperature[:-2]
103
  celcius=str(round((int(degree) - 32)* 5/9,1))+temperature[-2]+'C'
104
+ return (celcius)
105
+
106
+ def get_rates():
107
+ r = requests.get(f'https://www.kisandeals.com/mandiprices/ALL/TAMIL-NADU/ALL')
108
+ soup=BeautifulSoup(r.text,'html.parser')
109
+ table= soup.find_all('table')[0]
110
+ df = pd.read_html(str(table))
111
+ df=pd.DataFrame(df[0])
112
+ df.drop(columns=['Quintal Price'],inplace=True)
113
+ d={}
114
+ for i in range(len(df)):
115
+ d[df.iloc[i,0]]=df.iloc[i,1]
116
+ return str(d)+' This prices are for 1 kg'