From b68012375dccc61fea0c5efc5ccb7446596bd00a Mon Sep 17 00:00:00 2001 From: Lei PAN Date: Sun, 3 Sep 2023 23:18:25 +0200 Subject: [PATCH] delete used file --- src/{utils => passport}/Passport_MRZutile.py | 14 ++-- src/passport/__init__.py | 0 src/{utils => passport}/card_MRZutile.py | 0 src/utils/export_valid_profiles.py | 73 -------------------- 4 files changed, 7 insertions(+), 80 deletions(-) rename src/{utils => passport}/Passport_MRZutile.py (89%) mode change 100644 => 100755 create mode 100644 src/passport/__init__.py rename src/{utils => passport}/card_MRZutile.py (100%) mode change 100644 => 100755 delete mode 100644 src/utils/export_valid_profiles.py diff --git a/src/utils/Passport_MRZutile.py b/src/passport/Passport_MRZutile.py old mode 100644 new mode 100755 similarity index 89% rename from src/utils/Passport_MRZutile.py rename to src/passport/Passport_MRZutile.py index 46045af..e8d126b --- a/src/utils/Passport_MRZutile.py +++ b/src/passport/Passport_MRZutile.py @@ -22,14 +22,14 @@ def decode(s: str) -> str: return bytes(res).decode('gb2312') -chinese_name = "陈欣宁" -first_name = "xinning" -last_name = "chen" -passport_number = "E60999212" -birth_day = "970115" +chinese_name = "鲁思思" +first_name = "sisi" +last_name = "lu" +passport_number = "E96619397" +birth_day = "981215" sex = "F" # sex = "M" -expire_date = "280116" +expire_date = "290116" encoded_chinese_name = encode(chinese_name) print(encoded_chinese_name) @@ -38,7 +38,7 @@ for i in range(0, optional_data_length): encoded_chinese_name = encoded_chinese_name + "<" # optinal_data = "MFMLMANK<<< str: - # write_the_valid_profiles_to_excel() - S = 8 # number of characters in the string. - # call random.choices() string module to find the string in Uppercase + numeric data. - ran = ''.join(random.choices(string.digits, k=S)) - id_number = "57" + str(ran) - print("The randomly generated string is : 94" + str(ran)) # print the random data - return id_number - - -def write_the_valid_profiles_to_excel(): - day_list = ['2022-06-02'] - - collection = [] - for day in day_list: - collection.extend(definitions.firebase_store_manager.get_all_successful_items_for_day(day, source_from=None).stream()) - - valid_contacts = [] - # exist_contacts = ExcelHelper().read_contacts() - for valid_appointment in collection: - reserve_pojo = ReserveResultPojo.from_firestore_dict(valid_appointment.to_dict()) - # check whether the contact exists already - # exist = [contact for contact in valid_contacts if contact.mail == reserve_pojo.email] - # if len(exist) == 0: - contact = ContactPojo(reserve_pojo.phone, passport_number=get_random_id_number(), - last_name=reserve_pojo.lastName, first_name=reserve_pojo.firstName, ccid="", - mail=reserve_pojo.email, position=0) - # seed = 8 # number of characters in the string. - # call random.choices() string module to find the string in Uppercase + numeric data. - # contact.passport = get_random_id_number() - # if contact.passport == None or len(contact.passport) == 0: - # old_contact = [item for item in exist_contacts if item.mail == contact.mail] - # if len(old_contact) > 0: - # contact.passport = old_contact[0].passport - - print(contact) - valid_contacts.append(contact) - - row = 0 - col = 0 - # Create a workbook and add a worksheet. - workbook = xlsxwriter.Workbook('valid_profile.xlsx') - header_data = ['name', 'phone', 'passport', 'email', 'ccid', 'position'] - worksheet = workbook.add_worksheet() - header_format = workbook.add_format({'bold': True}) - - for col_num, data in enumerate(header_data): - worksheet.write(row, col_num, data, header_format) - row = row + 1 - for info in valid_contacts: - # Iterate over the data and write it out row by row. - worksheet.write(row, col, "{} {}".format(info.last_name, info.first_name)) - worksheet.write(row, col + 1, info.phone) - worksheet.write(row, col + 2, info.passport) - worksheet.write(row, col + 3, info.mail) - worksheet.write(row, col + 4, info.ccid) - row += 1 - workbook.close() - - -if __name__ == '__main__': - # get_random_id_number() - write_the_valid_profiles_to_excel()