contact-person-profile-csv-imp-local 0.0.32__py3-none-any.whl → 0.0.34__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 +26 -9
- {contact_person_profile_csv_imp_local-0.0.32.dist-info → contact_person_profile_csv_imp_local-0.0.34.dist-info}/METADATA +1 -1
- {contact_person_profile_csv_imp_local-0.0.32.dist-info → contact_person_profile_csv_imp_local-0.0.34.dist-info}/RECORD +5 -5
- {contact_person_profile_csv_imp_local-0.0.32.dist-info → contact_person_profile_csv_imp_local-0.0.34.dist-info}/WHEEL +0 -0
- {contact_person_profile_csv_imp_local-0.0.32.dist-info → contact_person_profile_csv_imp_local-0.0.34.dist-info}/top_level.txt +0 -0
|
@@ -46,6 +46,10 @@ CONTACT_PERSON_PROFILE_CSV_SYSTEM_ID = 1
|
|
|
46
46
|
DEFAULT_LOCATION_ID = LocationLocalConstants.UNKNOWN_LOCATION_ID
|
|
47
47
|
DEFAULT_PROFILE_ID = 0
|
|
48
48
|
|
|
49
|
+
GOOGLE_CSV_DATA_SOURCE_TYPE_ID = 16
|
|
50
|
+
OUTLOOK_CSV_DATA_SOURCE_TYPE_ID = 17
|
|
51
|
+
LINKEDIN_CSV_DATA_SOURCE_TYPE_ID = 18
|
|
52
|
+
BGU_COURSE_CSV_DATA_SOURCE_TYPE_ID = 57
|
|
49
53
|
RISHON_MUNI_EXHIBITOR_CSV_DATA_SOURCE_TYPE_ID = 60
|
|
50
54
|
|
|
51
55
|
|
|
@@ -202,7 +206,7 @@ class CSVToContactPersonProfile(GenericCRUD, metaclass=MetaLogger,
|
|
|
202
206
|
csv_file_path = csv_path
|
|
203
207
|
else:
|
|
204
208
|
script_dir = os.path.dirname(os.path.abspath(__file__))
|
|
205
|
-
csv_file_path = os.path.join(script_dir, directory_name or '', file_name)
|
|
209
|
+
csv_file_path = os.path.join(script_dir, '..', directory_name or '', file_name)
|
|
206
210
|
if not os.path.exists(csv_file_path):
|
|
207
211
|
raise FileNotFoundError(f"File {csv_file_path} not found")
|
|
208
212
|
|
|
@@ -288,8 +292,8 @@ class CSVToContactPersonProfile(GenericCRUD, metaclass=MetaLogger,
|
|
|
288
292
|
# contact_dict['last_name'] = process_last_name(
|
|
289
293
|
# original_last_name=contact_dict['last_name'])
|
|
290
294
|
|
|
291
|
-
# TODO This should be executed also by Google Contact Sync (please make sure it is in
|
|
292
|
-
#
|
|
295
|
+
# TODO This should be executed also by Google Contact Sync (please make sure it is in
|
|
296
|
+
# people-local-python-package i.e. get_display_name(first_name, last_name, organization) -> str
|
|
293
297
|
if contact_dict.get('display_as') is None:
|
|
294
298
|
contact_dict['display_as'] = contact_dict.get(
|
|
295
299
|
'first_name') or "" # prevent None
|
|
@@ -306,7 +310,8 @@ class CSVToContactPersonProfile(GenericCRUD, metaclass=MetaLogger,
|
|
|
306
310
|
# TODO We should take care of situation which the contact already exists and we need to update it
|
|
307
311
|
contact_dict["data_source_instance_id"] = data_source_instance_id
|
|
308
312
|
contact_dict["data_source_type_id"] = data_source_type_id
|
|
309
|
-
|
|
313
|
+
source_str = self.get_data_source_type_name_by_data_source_type_id(data_source_type_id) or "CSV Import"
|
|
314
|
+
contact_dict["source"] = source_str
|
|
310
315
|
contact_dict["owner_profile_id"] = profile_id
|
|
311
316
|
contact_dict["system_id"] = system_id
|
|
312
317
|
contact_dict = CSVToContactPersonProfile.fix_contact_dict_by_data_source_type(
|
|
@@ -653,14 +658,14 @@ class CSVToContactPersonProfile(GenericCRUD, metaclass=MetaLogger,
|
|
|
653
658
|
def __insert_importer(self, contact_id: int, location_id: int, user_external_id: int,
|
|
654
659
|
data_source_type_id: int, data_source_instance_id: int) -> int:
|
|
655
660
|
# TODO: Shall we consider the url of csv's as the following? Use Sql2Code. Use const enum
|
|
656
|
-
if data_source_type_id ==
|
|
661
|
+
if data_source_type_id == GOOGLE_CSV_DATA_SOURCE_TYPE_ID:
|
|
657
662
|
url = "www.google.com"
|
|
658
|
-
elif data_source_type_id ==
|
|
663
|
+
elif data_source_type_id == OUTLOOK_CSV_DATA_SOURCE_TYPE_ID:
|
|
659
664
|
url = "www.outlook.com"
|
|
660
|
-
elif data_source_type_id ==
|
|
665
|
+
elif data_source_type_id == LINKEDIN_CSV_DATA_SOURCE_TYPE_ID:
|
|
661
666
|
url = "www.linkedin.com"
|
|
662
667
|
# TODO Please change all Magic Numbers to data generated by Sql2Code
|
|
663
|
-
elif data_source_type_id ==
|
|
668
|
+
elif data_source_type_id == BGU_COURSE_CSV_DATA_SOURCE_TYPE_ID:
|
|
664
669
|
url = None
|
|
665
670
|
elif data_source_type_id == RISHON_MUNI_EXHIBITOR_CSV_DATA_SOURCE_TYPE_ID:
|
|
666
671
|
url = None
|
|
@@ -873,4 +878,16 @@ class CSVToContactPersonProfile(GenericCRUD, metaclass=MetaLogger,
|
|
|
873
878
|
if cellphone_number.startswith('0'):
|
|
874
879
|
cellphone_number = '+972 ' + cellphone_number
|
|
875
880
|
contact_dict['phone1'] = cellphone_number
|
|
876
|
-
return contact_dict
|
|
881
|
+
return contact_dict
|
|
882
|
+
|
|
883
|
+
def get_data_source_type_name_by_data_source_type_id(self, data_source_type_id: int) -> str:
|
|
884
|
+
if data_source_type_id == GOOGLE_CSV_DATA_SOURCE_TYPE_ID:
|
|
885
|
+
return "Google Contact CSV File"
|
|
886
|
+
elif data_source_type_id == OUTLOOK_CSV_DATA_SOURCE_TYPE_ID:
|
|
887
|
+
return "Outlook Contact CSV File"
|
|
888
|
+
elif data_source_type_id == LINKEDIN_CSV_DATA_SOURCE_TYPE_ID:
|
|
889
|
+
return "Linkedin Contact CSV File"
|
|
890
|
+
elif data_source_type_id == BGU_COURSE_CSV_DATA_SOURCE_TYPE_ID:
|
|
891
|
+
return "BGU Course CSV File"
|
|
892
|
+
elif data_source_type_id == RISHON_MUNI_EXHIBITOR_CSV_DATA_SOURCE_TYPE_ID:
|
|
893
|
+
return "Rishon Muni Exhibitor CSV File"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: contact-person-profile-csv-imp-local
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.34
|
|
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
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
contact_person_profile_csv_imp_local/CSVToContactPersonProfile.py,sha256=
|
|
1
|
+
contact_person_profile_csv_imp_local/CSVToContactPersonProfile.py,sha256=cxk42Vth14ipxbeoUnoQLkqMpsn54dF3_gD23c99_Zw,48853
|
|
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=eE0Bg2dCPrmG72K20k0_KOckc61C9cGSgH0Zgae_lbk,957
|
|
4
|
-
contact_person_profile_csv_imp_local-0.0.
|
|
5
|
-
contact_person_profile_csv_imp_local-0.0.
|
|
6
|
-
contact_person_profile_csv_imp_local-0.0.
|
|
7
|
-
contact_person_profile_csv_imp_local-0.0.
|
|
4
|
+
contact_person_profile_csv_imp_local-0.0.34.dist-info/METADATA,sha256=cHbEqwedaJa_MQZgK4dPOj8tw1rElGFV1QHw6Ts6FFA,1481
|
|
5
|
+
contact_person_profile_csv_imp_local-0.0.34.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
|
6
|
+
contact_person_profile_csv_imp_local-0.0.34.dist-info/top_level.txt,sha256=at6BnVzULDB109KZx9Cl9ClCHU4c0ykfV38WX-QR71U,37
|
|
7
|
+
contact_person_profile_csv_imp_local-0.0.34.dist-info/RECORD,,
|
|
File without changes
|