contact-person-profile-csv-imp-local 0.0.32__tar.gz → 0.0.34__tar.gz

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.
Files changed (13) hide show
  1. {contact_person_profile_csv_imp_local-0.0.32 → contact_person_profile_csv_imp_local-0.0.34}/PKG-INFO +1 -1
  2. {contact_person_profile_csv_imp_local-0.0.32 → contact_person_profile_csv_imp_local-0.0.34}/contact_person_profile_csv_imp_local/src/CSVToContactPersonProfile.py +26 -9
  3. {contact_person_profile_csv_imp_local-0.0.32 → contact_person_profile_csv_imp_local-0.0.34}/contact_person_profile_csv_imp_local.egg-info/PKG-INFO +1 -1
  4. {contact_person_profile_csv_imp_local-0.0.32 → contact_person_profile_csv_imp_local-0.0.34}/setup.py +1 -1
  5. {contact_person_profile_csv_imp_local-0.0.32 → contact_person_profile_csv_imp_local-0.0.34}/README.md +0 -0
  6. {contact_person_profile_csv_imp_local-0.0.32 → contact_person_profile_csv_imp_local-0.0.34}/contact_person_profile_csv_imp_local/src/__init__.py +0 -0
  7. {contact_person_profile_csv_imp_local-0.0.32 → contact_person_profile_csv_imp_local-0.0.34}/contact_person_profile_csv_imp_local/src/contact_person_profile_csv_imp_local_constants.py +0 -0
  8. {contact_person_profile_csv_imp_local-0.0.32 → contact_person_profile_csv_imp_local-0.0.34}/contact_person_profile_csv_imp_local.egg-info/SOURCES.txt +0 -0
  9. {contact_person_profile_csv_imp_local-0.0.32 → contact_person_profile_csv_imp_local-0.0.34}/contact_person_profile_csv_imp_local.egg-info/dependency_links.txt +0 -0
  10. {contact_person_profile_csv_imp_local-0.0.32 → contact_person_profile_csv_imp_local-0.0.34}/contact_person_profile_csv_imp_local.egg-info/requires.txt +0 -0
  11. {contact_person_profile_csv_imp_local-0.0.32 → contact_person_profile_csv_imp_local-0.0.34}/contact_person_profile_csv_imp_local.egg-info/top_level.txt +0 -0
  12. {contact_person_profile_csv_imp_local-0.0.32 → contact_person_profile_csv_imp_local-0.0.34}/pyproject.toml +0 -0
  13. {contact_person_profile_csv_imp_local-0.0.32 → contact_person_profile_csv_imp_local-0.0.34}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: contact-person-profile-csv-imp-local
3
- Version: 0.0.32
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
@@ -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 people-local-python-package
292
- # i.e. get_display_name(first_name, last_name, organization) -> str
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
- contact_dict["source"] = "Import"
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 == 16:
661
+ if data_source_type_id == GOOGLE_CSV_DATA_SOURCE_TYPE_ID:
657
662
  url = "www.google.com"
658
- elif data_source_type_id == 17:
663
+ elif data_source_type_id == OUTLOOK_CSV_DATA_SOURCE_TYPE_ID:
659
664
  url = "www.outlook.com"
660
- elif data_source_type_id == 18:
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 == 57: # BGU Course csv
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.32
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
@@ -5,7 +5,7 @@ package_dir = PACKAGE_NAME.replace("-", "_")
5
5
 
6
6
  setuptools.setup(
7
7
  name=PACKAGE_NAME,
8
- version='0.0.32', # https://pypi.org/project/contact-person-profile-csv-imp-local/
8
+ version='0.0.34', # https://pypi.org/project/contact-person-profile-csv-imp-local/
9
9
  author="Circles",
10
10
  author_email="info@circles.ai",
11
11
  description="PyPI Package for Circles CSVToContactPersonProfile-local Local/Remote Python",