add extract_name_with_pinyinlist.py
This commit is contained in:
@@ -39,6 +39,7 @@ class ExcelHelper:
|
||||
print(user_agent_list)
|
||||
|
||||
def read_contacts(self, file_name=CONTACT_LIST_FILE) -> list:
|
||||
print("read file " + file_name)
|
||||
contact_list_in_json = pandas.read_excel(file_name).to_json(orient='records')
|
||||
contact_dict_list = json.loads(contact_list_in_json)
|
||||
contact_list = []
|
||||
@@ -60,8 +61,8 @@ class ExcelHelper:
|
||||
contact_list.append(contact)
|
||||
return contact_list
|
||||
|
||||
def check_contact_list(self):
|
||||
contact_list = self.read_contacts()
|
||||
def check_contact_list(self, file_name=CONTACT_LIST_FILE):
|
||||
contact_list = self.read_contacts(file_name)
|
||||
for contact in contact_list:
|
||||
if contact.first_name is None or len(contact.first_name) == 0:
|
||||
print("error in firstName for " + contact.mail)
|
||||
@@ -227,12 +228,12 @@ def save_mails_to_db():
|
||||
|
||||
if __name__ == '__main__':
|
||||
# excel_reader = ExcelHelper()
|
||||
# contacts = excel_reader.read_names("/Users/lpan/Downloads/10_rambler_ru_23_03_2023.xlsx")
|
||||
# contacts = excel_reader.read_names("/Users/lpan/Downloads/gmail_10.xlsx")
|
||||
# print(contacts)
|
||||
# write_new_contacts_to_excel(valid_contacts=contacts)
|
||||
# excel_reader = ExcelHelper()
|
||||
# excel_reader.check_contact_list()
|
||||
save_mails_to_db()
|
||||
excel_reader = ExcelHelper()
|
||||
excel_reader.check_contact_list("/Users/lpan/Desktop/contact_email_valid.xlsx")
|
||||
# save_mails_to_db()
|
||||
# for mail in excel_reader.read_mails_and_pwd():
|
||||
# MONGO_STORE_MANAGER.insert_email(mail)
|
||||
# for i in range(1, 64):
|
||||
|
||||
Reference in New Issue
Block a user