add method to check mail existence
This commit is contained in:
@@ -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)
|
||||
@@ -22,18 +22,21 @@ def decode(s: str) -> str:
|
||||
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)
|
||||
print(encoded_chinese_name)
|
||||
optional_data_length = 14 - len(encoded_chinese_name)
|
||||
for i in range(0, optional_data_length):
|
||||
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位
|
||||
# nationality = "CHN"
|
||||
nationality = "CHN"
|
||||
@@ -45,7 +48,6 @@ else:
|
||||
optinal_data = encoded_chinese_name # 14位
|
||||
document_prefix = "PO"
|
||||
|
||||
expire_date = "270116"
|
||||
|
||||
# first_name = "Lei"
|
||||
# last_name = "PAN"
|
||||
|
||||
Reference in New Issue
Block a user