contact-person-profile-csv-imp-local 0.0.46__py3-none-any.whl → 0.0.48__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.
- contact_person_profile_csv_imp_local/CSVToContactPersonProfile.py +4 -64
- {contact_person_profile_csv_imp_local-0.0.46.dist-info → contact_person_profile_csv_imp_local-0.0.48.dist-info}/METADATA +2 -2
- contact_person_profile_csv_imp_local-0.0.48.dist-info/RECORD +7 -0
- {contact_person_profile_csv_imp_local-0.0.46.dist-info → contact_person_profile_csv_imp_local-0.0.48.dist-info}/WHEEL +1 -1
- contact_person_profile_csv_imp_local-0.0.46.dist-info/RECORD +0 -7
- {contact_person_profile_csv_imp_local-0.0.46.dist-info → contact_person_profile_csv_imp_local-0.0.48.dist-info}/top_level.txt +0 -0
|
@@ -173,32 +173,11 @@ class CSVToContactPersonProfile(
|
|
|
173
173
|
# Otherwise, return the value
|
|
174
174
|
return value
|
|
175
175
|
|
|
176
|
-
|
|
177
|
-
#
|
|
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?
|
|
176
|
+
|
|
177
|
+
# What are the diff between csv_path and directory_name?
|
|
199
178
|
# ans: csv_path is the full path to the csv file, directory_name is the directory where the csv file is located
|
|
200
179
|
|
|
201
|
-
#
|
|
180
|
+
# I think file name should be after directory_name and csv_path
|
|
202
181
|
# ans: it cannot be after directory_name and csv_path because it is a required parameter
|
|
203
182
|
|
|
204
183
|
# TODO: break this function into smaller functions
|
|
@@ -227,7 +206,7 @@ class CSVToContactPersonProfile(
|
|
|
227
206
|
:return:
|
|
228
207
|
"""
|
|
229
208
|
data_source_type_name = DataSources().get_data_source_name_by_id(data_source_type_id)
|
|
230
|
-
#
|
|
209
|
+
# There can be multiple profiles with the same email, why not to query `user_external_table`.`main_profile_id`?
|
|
231
210
|
# Answer: first, We can't query tables with GenericCRUD, second, we may not find profile_id in user_external table
|
|
232
211
|
# and may have to insert a new record to user_external_table, in this case we need profile_id from profile_view
|
|
233
212
|
profile_id = self.select_one_value_by_column_and_value(
|
|
@@ -252,7 +231,6 @@ class CSVToContactPersonProfile(
|
|
|
252
231
|
column_value=user_external_username)
|
|
253
232
|
'''
|
|
254
233
|
self.logger.info(f"profile_id: {profile_id}")
|
|
255
|
-
# TODO Please explain
|
|
256
234
|
# if csv_path is provided then we will use the full path
|
|
257
235
|
# if csv_path is not provided then we will use the directory_name and file_name to create the full path
|
|
258
236
|
# 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
|
|
@@ -331,21 +309,6 @@ class CSVToContactPersonProfile(
|
|
|
331
309
|
contact_dict['is_test_data'] = self.is_test_data
|
|
332
310
|
|
|
333
311
|
# 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
|
-
|
|
349
312
|
# TODO This should be executed also by Google Contact Sync (please make sure it is in
|
|
350
313
|
# people-local-python-package i.e. get_display_name(first_name, last_name, organization) -> str
|
|
351
314
|
if contact_dict.get('display_as') is None:
|
|
@@ -357,8 +320,6 @@ class CSVToContactPersonProfile(
|
|
|
357
320
|
if not contact_dict['display_as'] and contact_dict.get('organization'):
|
|
358
321
|
contact_dict['display_as'] += " " + contact_dict['organization']
|
|
359
322
|
|
|
360
|
-
# TODO if contact_dict['display_as'] still empty raise?
|
|
361
|
-
|
|
362
323
|
# TODO process_notes( contact_dict[notes] )
|
|
363
324
|
|
|
364
325
|
# TODO We should take care of situation which the contact already exists and we need to update it
|
|
@@ -378,9 +339,6 @@ class CSVToContactPersonProfile(
|
|
|
378
339
|
data_source_instance_id=data_source_instance_id,
|
|
379
340
|
data_source_type_id=data_source_type_id)
|
|
380
341
|
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))
|
|
384
342
|
|
|
385
343
|
return contact_data_by_contact_id_dict
|
|
386
344
|
|
|
@@ -676,24 +634,6 @@ class CSVToContactPersonProfile(
|
|
|
676
634
|
|
|
677
635
|
return contact_phone_ids
|
|
678
636
|
|
|
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
|
|
697
637
|
def __insert_link_contact_user_external_by_contact_dict_and_user_external_dict(
|
|
698
638
|
self,
|
|
699
639
|
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.
|
|
3
|
+
Version: 0.0.48
|
|
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
|
|
@@ -10,7 +10,7 @@ Classifier: Operating System :: OS Independent
|
|
|
10
10
|
Description-Content-Type: text/markdown
|
|
11
11
|
Requires-Dist: contact-local>=0.0.48
|
|
12
12
|
Requires-Dist: logger-local>=0.0.135
|
|
13
|
-
Requires-Dist: database-mysql-local>=0.
|
|
13
|
+
Requires-Dist: database-mysql-local>=0.1.1
|
|
14
14
|
Requires-Dist: user-context-remote>=0.0.77
|
|
15
15
|
Requires-Dist: contact-email-address-local>=0.0.8
|
|
16
16
|
Requires-Dist: contact-group-local>=0.0.68
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
contact_person_profile_csv_imp_local/CSVToContactPersonProfile.py,sha256=7es96MO3T8BImP_s5NuImiWDYWvhow22rAhW-viLSsM,52300
|
|
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.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,,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
contact_person_profile_csv_imp_local/CSVToContactPersonProfile.py,sha256=HMZaoJTFg-PCg8Nc_hRm1iBikkLm67yxLFNMr-NXOFk,55492
|
|
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.46.dist-info/METADATA,sha256=ttYH12F5UlYj_QIHk12BQO2pXajxKereykJLZanuv7w,1585
|
|
5
|
-
contact_person_profile_csv_imp_local-0.0.46.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
|
6
|
-
contact_person_profile_csv_imp_local-0.0.46.dist-info/top_level.txt,sha256=at6BnVzULDB109KZx9Cl9ClCHU4c0ykfV38WX-QR71U,37
|
|
7
|
-
contact_person_profile_csv_imp_local-0.0.46.dist-info/RECORD,,
|