contact-person-profile-csv-imp-local 0.0.48__py3-none-any.whl → 0.0.49__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.
@@ -173,11 +173,32 @@ class CSVToContactPersonProfile(
173
173
  # Otherwise, return the value
174
174
  return value
175
175
 
176
-
177
- # What are the diff between csv_path and directory_name?
176
+ # # TODO Does this function should be here on in https://github.com/circles-zone/variable-local-python-package/tree/dev/variable_local_python_package/variable_local/src "field/field.py"?
177
+ # def __get_field_name(self, field_id: int, data_source_type_id: int) -> str:
178
+ # """
179
+ # Get the field name from the database
180
+ # :param field_id: The field ID
181
+ # :param data_source_type_id: The data source ID
182
+ # :return: The field name
183
+ # """
184
+ #
185
+ # 'data_source_type_id': data_source_type_id})
186
+
187
+ # self.set_schema(schema_name="data_source_field")
188
+ # data_source_field_tuples = self.select_multi_tuple_by_where(view_table_name="data_source_field_view",
189
+ # select_clause_value="external_field_name",
190
+ # where="data_source_type_id = %s AND field_id = %s",
191
+ # params=(data_source_type_id, field_id))
192
+
193
+ # if data_source_field_tuples:
194
+ #
195
+ # return data_source_field_tuples[0][0]
196
+ # return
197
+
198
+ # TODO what are the diff between csv_path and directory_name?
178
199
  # ans: csv_path is the full path to the csv file, directory_name is the directory where the csv file is located
179
200
 
180
- # I think file name should be after directory_name and csv_path
201
+ # TODO I think file name should be after directory_name and csv_path
181
202
  # ans: it cannot be after directory_name and csv_path because it is a required parameter
182
203
 
183
204
  # TODO: break this function into smaller functions
@@ -206,7 +227,7 @@ class CSVToContactPersonProfile(
206
227
  :return:
207
228
  """
208
229
  data_source_type_name = DataSources().get_data_source_name_by_id(data_source_type_id)
209
- # There can be multiple profiles with the same email, why not to query `user_external_table`.`main_profile_id`?
230
+ # TODO There can be multiple profiles with the same email, why not to query `user_external_table`.`main_profile_id`?
210
231
  # Answer: first, We can't query tables with GenericCRUD, second, we may not find profile_id in user_external table
211
232
  # and may have to insert a new record to user_external_table, in this case we need profile_id from profile_view
212
233
  profile_id = self.select_one_value_by_column_and_value(
@@ -231,6 +252,7 @@ class CSVToContactPersonProfile(
231
252
  column_value=user_external_username)
232
253
  '''
233
254
  self.logger.info(f"profile_id: {profile_id}")
255
+ # TODO Please explain
234
256
  # if csv_path is provided then we will use the full path
235
257
  # if csv_path is not provided then we will use the directory_name and file_name to create the full path
236
258
  # 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
@@ -309,6 +331,21 @@ class CSVToContactPersonProfile(
309
331
  contact_dict['is_test_data'] = self.is_test_data
310
332
 
311
333
  # TODO Please call get_display_name(first_name, last_name, organization) if display_as is empty
334
+
335
+ # for phone in ['phone1', 'phone2', 'phone3']:
336
+ # if contact_dict[phone] is None:
337
+ # continue
338
+ # phone_data = process_phone(original_phone_number=contact_dict[phone])
339
+ # if phone_data is None:
340
+ # continue
341
+ # else:
342
+ # contact_dict[phone] = phone_data['normalized_phone_number']
343
+
344
+ # contact_dict['first_name'] = process_first_name(
345
+ # original_first_name=contact_dict['first_name'])
346
+ # contact_dict['last_name'] = process_last_name(
347
+ # original_last_name=contact_dict['last_name'])
348
+
312
349
  # TODO This should be executed also by Google Contact Sync (please make sure it is in
313
350
  # people-local-python-package i.e. get_display_name(first_name, last_name, organization) -> str
314
351
  if contact_dict.get('display_as') is None:
@@ -320,6 +357,8 @@ class CSVToContactPersonProfile(
320
357
  if not contact_dict['display_as'] and contact_dict.get('organization'):
321
358
  contact_dict['display_as'] += " " + contact_dict['organization']
322
359
 
360
+ # TODO if contact_dict['display_as'] still empty raise?
361
+
323
362
  # TODO process_notes( contact_dict[notes] )
324
363
 
325
364
  # TODO We should take care of situation which the contact already exists and we need to update it
@@ -339,6 +378,9 @@ class CSVToContactPersonProfile(
339
378
  data_source_instance_id=data_source_instance_id,
340
379
  data_source_type_id=data_source_type_id)
341
380
  contact_data_by_contact_id_dict[contact_id] = contact_dict
381
+ # groups_linked_by_job_title = process_job_title(contact_id=contact_id, job_title=contact_dict['job_title'])
382
+ # if groups_linked_by_job_title is None:
383
+ # logger.info("No groups linked by job title to contact " + str(contact_id))
342
384
 
343
385
  return contact_data_by_contact_id_dict
344
386
 
@@ -634,6 +676,24 @@ class CSVToContactPersonProfile(
634
676
 
635
677
  return contact_phone_ids
636
678
 
679
+ # old, TODO, do we need it?
680
+ def __insert_link_contact_user_external(self, contact_dict: dict) -> int:
681
+ contact_id = contact_dict.get("contact_id")
682
+ print("Before " + __name__, file=sys.stderr, flush=True)
683
+ contact_user_external_id = \
684
+ self.contact_user_external.insert_contact_and_link_to_existing_or_new_user_external(
685
+ contact_dict=contact_dict,
686
+ contact_email_address_str=contact_dict["email1"],
687
+ contact_id=contact_id,
688
+ system_id=contact_dict.get("system_id"),
689
+ # TODO What happends if contact do not have email?
690
+ # TODO I'm not sure we should use contact_dict["email1"] for user_external_dict["username"] probably bug
691
+ user_external_dict={"username": contact_dict["email1"]}
692
+ )
693
+ print("After " + __name__, file=sys.stderr, flush=True)
694
+ return contact_user_external_id
695
+
696
+ # new
637
697
  def __insert_link_contact_user_external_by_contact_dict_and_user_external_dict(
638
698
  self,
639
699
  contact_dict: dict,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: contact-person-profile-csv-imp-local
3
- Version: 0.0.48
3
+ Version: 0.0.49
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
@@ -12,7 +12,7 @@ Requires-Dist: contact-local>=0.0.48
12
12
  Requires-Dist: logger-local>=0.0.135
13
13
  Requires-Dist: database-mysql-local>=0.1.1
14
14
  Requires-Dist: user-context-remote>=0.0.77
15
- Requires-Dist: contact-email-address-local>=0.0.8
15
+ Requires-Dist: contact-email-address-local>=0.0.40.1234
16
16
  Requires-Dist: contact-group-local>=0.0.68
17
17
  Requires-Dist: contact-location-local>=0.0.14
18
18
  Requires-Dist: contact-notes-local>=0.0.33
@@ -1,7 +1,7 @@
1
- contact_person_profile_csv_imp_local/CSVToContactPersonProfile.py,sha256=7es96MO3T8BImP_s5NuImiWDYWvhow22rAhW-viLSsM,52300
1
+ contact_person_profile_csv_imp_local/CSVToContactPersonProfile.py,sha256=HMZaoJTFg-PCg8Nc_hRm1iBikkLm67yxLFNMr-NXOFk,55492
2
2
  contact_person_profile_csv_imp_local/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
3
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.48.dist-info/METADATA,sha256=3-jN5sli2l_DxiUZqDBnDjUEOsvUenHsXAuJKgXwtr8,1583
5
- contact_person_profile_csv_imp_local-0.0.48.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
- contact_person_profile_csv_imp_local-0.0.48.dist-info/top_level.txt,sha256=at6BnVzULDB109KZx9Cl9ClCHU4c0ykfV38WX-QR71U,37
7
- contact_person_profile_csv_imp_local-0.0.48.dist-info/RECORD,,
4
+ contact_person_profile_csv_imp_local-0.0.49.dist-info/METADATA,sha256=9BJsQ8xIl06gt6fhxFDruFphRCa5u7Wg2FuOCIij0ag,1589
5
+ contact_person_profile_csv_imp_local-0.0.49.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
6
+ contact_person_profile_csv_imp_local-0.0.49.dist-info/top_level.txt,sha256=at6BnVzULDB109KZx9Cl9ClCHU4c0ykfV38WX-QR71U,37
7
+ contact_person_profile_csv_imp_local-0.0.49.dist-info/RECORD,,