add method to check mail existence

This commit is contained in:
2023-07-19 00:40:55 +02:00
parent 0a6f458d20
commit 4dffcbd3db
2 changed files with 26 additions and 8 deletions
+16
View File
@@ -0,0 +1,16 @@
from src.db.mongo_manager import MONGO_STORE_MANAGER
from src.utils.excel_reader import ExcelHelper
if __name__ == '__main__':
excel_reader = ExcelHelper()
contacts = excel_reader.read_contacts("/Users/lpan/Desktop/yahoo_aol.xlsx")
mail_list = MONGO_STORE_MANAGER.get_destination_emails()
print("mail_list size is " + str(len(mail_list)))
mail_raw_list =[]
for mail_address in mail_list:
mail_raw_list.append(mail_address.mail)
for contact in contacts:
if contact.mail not in mail_raw_list:
if "gmail" not in contact.mail:
print(contact.mail)
+10 -8
View File
@@ -22,18 +22,21 @@ def decode(s: str) -> str:
return bytes(res).decode('gb2312') return bytes(res).decode('gb2312')
chinese_name = "黄晴风" chinese_name = "陈欣宁"
first_name = "xinning"
last_name = "chen"
passport_number = "E60999212"
birth_day = "970115"
sex = "F"
# sex = "M"
expire_date = "280116"
encoded_chinese_name = encode(chinese_name) encoded_chinese_name = encode(chinese_name)
print(encoded_chinese_name) print(encoded_chinese_name)
optional_data_length = 14 - len(encoded_chinese_name) optional_data_length = 14 - len(encoded_chinese_name)
for i in range(0, optional_data_length): for i in range(0, optional_data_length):
encoded_chinese_name = encoded_chinese_name + "<" encoded_chinese_name = encoded_chinese_name + "<"
first_name = "Qingfeng"
last_name = "Huang"
passport_number = "991011946"
birth_day = "980118"
sex = "F"
# sex = "M"
# optinal_data = "MFMLMANK<<<<A9" #14位 # optinal_data = "MFMLMANK<<<<A9" #14位
# nationality = "CHN" # nationality = "CHN"
nationality = "CHN" nationality = "CHN"
@@ -45,7 +48,6 @@ else:
optinal_data = encoded_chinese_name # 14位 optinal_data = encoded_chinese_name # 14位
document_prefix = "PO" document_prefix = "PO"
expire_date = "270116"
# first_name = "Lei" # first_name = "Lei"
# last_name = "PAN" # last_name = "PAN"