contact-person-profile-csv-imp-local 0.0.50__py3-none-any.whl → 0.0.51__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -51,12 +51,12 @@ DEFAULT_PROFILE_ID = 0
51
51
  # Those methods should be called from the common method for this repo (contact-person-profile-csv-imp-local-python-package and google-contact-sync ...)
52
52
 
53
53
  # TODO def process_first_name( original_first_name: str) -> str: (move to people-local-python-package)
54
- # normilized_first_name = the first word in original_first_name
55
- # GroupsLocal.add_update_group_and_link_to_contact( normilized_first_name, is_group=true, contact_id) # When checking if exists, ignore the upper-case lower-case
56
- # return normilized_first_name
54
+ # normalized_first_name = the first word in original_first_name
55
+ # GroupsLocal.add_update_group_and_link_to_contact( normalized_first_name, is_group=true, contact_id) # When checking if exists, ignore the upper-case lower-case
56
+ # return normalized_first_name
57
57
 
58
58
  # TODO def process_last_name( original_last_name : str) -> str: (move to people-local-python-package)
59
- # normilized_last_name = Remove all the digits from the last_name
59
+ # normalized_last_name = Remove all the digits from the last name
60
60
  # GroupsLocal.add_update_group_and_link_to_contact( normilized_last_name, is_group=true, contact_id) # When checking if exists, ignore the upper-case lower-case
61
61
 
62
62
  # TODO def process_phone( original_phone_number: str) -> str: (move to phone-local-python-package)
@@ -75,7 +75,7 @@ DEFAULT_PROFILE_ID = 0
75
75
  # normalized_organization_name = GroupsLocal.add_update_group_and_link_to_contact( organization_name, is_organization=true) # When checking if the organization exists, remove suffix such as Ltd, Inc, בעמ... when searching ignore the uppper-case lower-case
76
76
 
77
77
  # TODO def process_department( department_name: str) -> str: (move to people-local-python-package
78
- # normalized_department_name = GroupsLocal.add_update_group_and_link_to_contact( department_name, is_department=true) # When searching ignore the upper-case lower-case, return the value with is_main == true
78
+ # normalized_department_name = GroupsLocal.add_update_group_and_link_to_contact( department_name, is_department=true) # When searching, ignore the upper-case lower-case, return the value with is_main == true
79
79
 
80
80
  # TODO def process_continent( continent_name: str) -> str: (move to location-local-python-package)
81
81
  # continent_id, normalized_continent_name = GroupsLocal.add_update_group_and_link_to_contact( continent_name, is_continent=true) # When checking if exists, ignore the upper-case lower-case, return the value with is_main == true
@@ -124,7 +124,8 @@ class CSVToContactPersonProfile(
124
124
  'contact_location', 'user_externals_local',
125
125
  'organizations_local', 'domain_local',
126
126
  'importers_local']
127
- GenericCRUD.__init__(self, default_schema_name="entity_type",
127
+ GenericCRUD.__init__(self, default_schema_name="profile",
128
+ default_view_table_name="profile_view",
128
129
  is_test_data=is_test_data)
129
130
  self.contact_entity_type_id = \
130
131
  self.select_one_value_by_column_and_value(
@@ -229,7 +230,7 @@ class CSVToContactPersonProfile(
229
230
  self.logger.info(f"profile_id: {profile_id}")
230
231
  # if csv_path is provided then we will use the full path
231
232
  # if csv_path is not provided then we will use the directory_name and file_name to create the full path
232
- # if directory_name is not provided the assumption is that the file is in the same directory as the script and not in a folder
233
+ # If directory_name is not provided, the assumption is that the file is in the same directory as the script and not in a folder
233
234
  if csv_path is not None:
234
235
  csv_file_path = csv_path
235
236
  else:
@@ -248,7 +249,7 @@ class CSVToContactPersonProfile(
248
249
 
249
250
  user_external_id = self.__get_user_external_id(user_external_username=user_external_username,
250
251
  profile_id=profile_id, system_id=system_id)
251
- # We create a new data_source_instance_id everytime we import a new csv file
252
+ # We create a new data_source_instance_id every time we import a new csv file
252
253
  data_source_instance_id = self.__get_data_source_instance_id(
253
254
  data_source_type_id=data_source_type_id, csv_file_path=csv_file_path,
254
255
  user_external_id=user_external_id, file_name=file_name,
@@ -331,6 +332,7 @@ class CSVToContactPersonProfile(
331
332
  contact_dict['display_as'] += " " + contact_dict['last_name']
332
333
  if not contact_dict['display_as'] and contact_dict.get('organization'):
333
334
  contact_dict['display_as'] += " " + contact_dict['organization']
335
+ # TODO if contact_dict['display_as'] still empty raise?
334
336
 
335
337
  # TODO process_notes( contact_dict[notes] )
336
338
 
@@ -351,6 +353,7 @@ class CSVToContactPersonProfile(
351
353
  data_source_instance_id=data_source_instance_id,
352
354
  data_source_type_id=data_source_type_id)
353
355
  contact_data_by_contact_id_dict[contact_id] = contact_dict
356
+ # groups_linked_by_job_title = process_job_title(contact_id=contact_id, job_title=contact_dict['job_title'])
354
357
 
355
358
  return contact_data_by_contact_id_dict
356
359
 
@@ -588,7 +591,9 @@ class CSVToContactPersonProfile(
588
591
  return linked_groups_results_list
589
592
 
590
593
  def __insert_link_contact_persons(self, contact_dict: dict) -> dict:
594
+ # TODO create and use mandatory_fields_to_link_contact_to_person_array
591
595
  if not contact_dict.get("first_name") and not contact_dict.get("last_name"):
596
+ # TODO logger.warning("Can't connect contact_id= contact.display_as= contact.organization to a person as we don't have first and last name
592
597
  return {}
593
598
  phones_local = PhonesLocal(is_test_data=self.is_test_data)
594
599
  contact_phone_number = contact_dict.get("phone1")
@@ -607,7 +612,7 @@ class CSVToContactPersonProfile(
607
612
 
608
613
  return contact_person_results_dict
609
614
 
610
- # TODO This method is confusing me as based on the name I was expected to to have two parameters
615
+ # TODO This method is confusing me, as based on the name, I was expecting to have two parameters
611
616
  # contact_dict and email_addresses but we are sending profile_id, please explain or fix
612
617
  def __insert_link_contact_email_addresses(self, contact_dict: dict) -> list[int]:
613
618
  email_addresses = self.contacts_local.get_contact_email_addresses_from_contact_dict(
@@ -719,7 +724,7 @@ class CSVToContactPersonProfile(
719
724
  # TODO merge this method with the method in google-contact-sync
720
725
  def __insert_importer(self, contact_id: int, location_id: int, user_external_id: int,
721
726
  data_source_type_id: int, data_source_instance_id: int) -> int:
722
- # TODO: Shall we consider the url of csv's as the following? Use Sql2Code. Use const enum
727
+ # TODO: Shall we consider the url of CSVs as the following? Use Sql2Code. Use const enum
723
728
  if data_source_type_id == CSVToContactPersonProfileConstants.GOOGLE_CSV_DATA_SOURCE_TYPE_ID:
724
729
  url = "www.google.com"
725
730
  elif data_source_type_id == CSVToContactPersonProfileConstants.OUTLOOK_CSV_DATA_SOURCE_TYPE_ID:
@@ -744,10 +749,10 @@ class CSVToContactPersonProfile(
744
749
 
745
750
  return importer_id
746
751
 
747
- # TODO Move this method to ContactsLocal if not exists already
752
+ # TODO Move this method to ContactsLocal if not already exist
748
753
  def __procces_location_of_contact(self, contact_dict: dict) -> dict or None:
749
754
  """
750
- Process location of Google contact
755
+ Process the location of the Google contact
751
756
  :param contact_dict: location_dict
752
757
  :return: location_dict
753
758
  """
@@ -776,6 +781,7 @@ class CSVToContactPersonProfile(
776
781
  and not email_addresses_list):
777
782
  return
778
783
  # TODO: How can we add location type?
784
+ # TODO Rename to processed_location_dicts
779
785
  proccessed_location_dicts = []
780
786
  if is_contact_location1:
781
787
  location_dict = self.__create_location_dict(
@@ -941,6 +947,7 @@ class CSVToContactPersonProfile(
941
947
  @staticmethod
942
948
  # TODO Move this function to python-sdk
943
949
  def detect_encoding(file_path: str, data_source_type_id: int = None):
950
+ # TODO Do not use hard-coded values, get it from the data_source_type repo/package
944
951
  if data_source_type_id in [16, 17, 18]:
945
952
  detect_encodinfg_result = "utf-8"
946
953
  else:
@@ -20,6 +20,7 @@ class CSVToContactPersonProfileConstants:
20
20
  'developer_email': DEVELOPER_EMAIL
21
21
  }
22
22
 
23
+ # TODO search for the source_type_id in the database and remove those constants
23
24
  GOOGLE_CSV_DATA_SOURCE_TYPE_ID = 16
24
25
  LINKEDIN_CSV_DATA_SOURCE_TYPE_ID = 18
25
26
  OUTLOOK_CSV_DATA_SOURCE_TYPE_ID = 17
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: contact-person-profile-csv-imp-local
3
- Version: 0.0.50
3
+ Version: 0.0.51
4
4
  Summary: PyPI Package for Circles CSVToContactPersonProfile-local Local/Remote Python
5
5
  Home-page: https://github.com/circles-zone/contact-person-profile-csv-imp-local-python-package
6
6
  Author: Circles
@@ -0,0 +1,7 @@
1
+ contact_person_profile_csv_imp_local/CSVToContactPersonProfile.py,sha256=86cINZLvSqFNFYD7Z_q-WqNoIXNX3BFkDfHJZgUYg1U,53428
2
+ contact_person_profile_csv_imp_local/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
+ contact_person_profile_csv_imp_local/contact_person_profile_csv_imp_local_constants.py,sha256=Wj_mBaolIK-h6To7YGeUGmgop5U95_Pfl7NXrob-6Ws,1264
4
+ contact_person_profile_csv_imp_local-0.0.51.dist-info/METADATA,sha256=ZADrJdCdI_Ou9ORHltO9d8cQep0g8tHKcYaN1uYIM3I,1589
5
+ contact_person_profile_csv_imp_local-0.0.51.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
+ contact_person_profile_csv_imp_local-0.0.51.dist-info/top_level.txt,sha256=at6BnVzULDB109KZx9Cl9ClCHU4c0ykfV38WX-QR71U,37
7
+ contact_person_profile_csv_imp_local-0.0.51.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- contact_person_profile_csv_imp_local/CSVToContactPersonProfile.py,sha256=4sUZRqO8_s_uxPEB5VFbwvHvmCKqnaKW8-T49VaJZJs,52782
2
- contact_person_profile_csv_imp_local/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
- contact_person_profile_csv_imp_local/contact_person_profile_csv_imp_local_constants.py,sha256=SsMFKnI7y3P_kQxH21rxKnX7H4MZlemBy5vuv_Ns_a4,1180
4
- contact_person_profile_csv_imp_local-0.0.50.dist-info/METADATA,sha256=sI9EXLOEYRrGb19fOKD-VLs1feswm8JL06rHFQ5JmpM,1589
5
- contact_person_profile_csv_imp_local-0.0.50.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
- contact_person_profile_csv_imp_local-0.0.50.dist-info/top_level.txt,sha256=at6BnVzULDB109KZx9Cl9ClCHU4c0ykfV38WX-QR71U,37
7
- contact_person_profile_csv_imp_local-0.0.50.dist-info/RECORD,,