optimize check_results.py and add export contact

This commit is contained in:
Lei PAN
2022-05-31 23:14:55 +02:00
parent d45f78c44a
commit 08318eef74
3 changed files with 7 additions and 6 deletions
+1 -1
View File
@@ -116,7 +116,7 @@ if __name__ == '__main__':
reserve_pojo = ReserveResultPojo.from_firestore_dict(appointment.to_dict())
result_list.append(reserve_pojo)
with ThreadPoolExecutor(max_workers=20) as executor:
with ThreadPoolExecutor(max_workers=10) as executor:
for reserve in result_list:
count = count + 1
if reserve.accepted is None or ResultEnum.PENDING.value == reserve.accepted:
+5 -4
View File
@@ -85,9 +85,10 @@ def get_random_phone_numbers():
def generate_email_from_name(first_name: str, last_name: str) -> str:
length = 3 # number of characters in the string.
length = 4 # number of characters in the string.
ran = ''.join(random.choices(string.digits, k=length))
email = "{}{}{}@163.com".format(last_name.lower(), first_name.lower(), ran)
separator = ['.', '_', '']
email = "{}{}{}{}@163.com".format(last_name.lower(), random.choice(separator), first_name.lower(), ran)
print(email)
return email
@@ -128,6 +129,6 @@ def write_new_contacts_to_excel(valid_contacts: list):
if __name__ == '__main__':
excel_reader = ExcelHelper()
contacts = excel_reader.read_names("new_profile_500.xlsx")
contacts = excel_reader.read_names("C:/Users/landd/Desktop/1000.xlsx")
print(contacts)
# write_new_contacts_to_excel(valid_contacts=contacts)
write_new_contacts_to_excel(valid_contacts=contacts)
+1 -1
View File
@@ -19,7 +19,7 @@ def get_random_id_number() -> str:
def write_the_valid_profiles_to_excel():
day_list = ['2022-05-28']
day_list = ['2022-05-30']
collection = []
for day in day_list: