-
Notifications
You must be signed in to change notification settings - Fork 0
/
test2.py
46 lines (43 loc) · 1.24 KB
/
test2.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import pymongo
import pandas as pd
from smtplib import SMTP_SSL as SMTP
from email.message import EmailMessage
try:
s = SMTP('smtp.gmail.com', 465)
s.login("[email protected]", "")
msg = EmailMessage()
msg.set_content('This is my message')
msg['Subject'] = 'Subject'
msg['From'] = "[email protected]"
msg['To'] = "[email protected]"
s.send_message(msg)
s.quit()
except Exception:
print(Exception)
#s.quit()
client = pymongo.MongoClient('mongodb://127.0.0.1:27017/')
db = client['FIS_Chatbot']
col1 = db['locations']
df = "-1"
col = db['Appointment']
#df = col1.find_one({},{'location_name':Location})
df = pd.DataFrame(list(col1.find()))
Location = 'I.S. 117'
try:
v=df[df['location_name']==Location]
print(v)
#fulfillmentText = 'Appointment Booked'
except Exception:
fulfillmentText = 'please enter valid pantry name'
if(len(v)==0):
fulfillmentText = 'please enter valid pantry name'
else:
#fulfillmentText = 'Appointment Booked'
addDict = {'name' : 'Vatsal',
'email' : '[email protected]',
'phone' : 7043879131,
'live_appointment' : 'Yes',
'Appointment_Status' : 'Yes',
'Appointment_time' : '7:00',
'usertype' : 'Donor'}
col.insert_one(addDict)