python-eigen-ingenuity 0.5.30b3__py3-none-any.whl → 0.5.30b4__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.
@@ -49,7 +49,26 @@ class FileAnalyser():
49
49
  contents = CSVContentsManager(csv_data, self.header_mappings, self.alias_mappings, self.default_data_type)
50
50
  except Exception as exc:
51
51
  self.logger(f"Error reading file with forced encoding {self.force_encoding}: {exc}")
52
- return 'incorrect file format', contents, []
52
+ try:
53
+ self.logger('Trying to read file with utf-8 encoding')
54
+ with open(file_name, encoding='utf-8') as csv_file:
55
+ csv_data = csv.reader(csv_file, delimiter=self.separator)
56
+ contents = CSVContentsManager(csv_data, self.header_mappings, self.alias_mappings, self.default_data_type)
57
+ except:
58
+ try:
59
+ self.logger('utf-8 encoding failed, trying to auto-detect encoding')
60
+ with open(file_name) as csv_file:
61
+ csv_data = csv.reader(csv_file, delimiter=self.separator)
62
+ contents = CSVContentsManager(csv_data, self.header_mappings, self.alias_mappings, self.default_data_type)
63
+ except:
64
+ try:
65
+ self.logger('auto-detect encoding failed, trying iso-8859-1')
66
+
67
+ with open(file_name, encoding='iso-8859-1') as csv_file:
68
+ csv_data = csv.reader(csv_file, delimiter=self.separator)
69
+ contents = CSVContentsManager(csv_data, self.header_mappings, self.alias_mappings, self.default_data_type)
70
+ except:
71
+ return 'incorrect file format', contents, []
53
72
  elif self.detect_encoding:
54
73
  try:
55
74
  self.logger('Detecting file encoding...')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-eigen-ingenuity
3
- Version: 0.5.30b3
3
+ Version: 0.5.30b4
4
4
  Summary: A python library used to query data from the Eigen Ingenuity system
5
5
  Home-page: https://www.eigen.co/
6
6
  Author: Murray Callander
@@ -43,7 +43,7 @@ modelbuilder/src/assetmodelutilities.py,sha256=1j-S2CKaxcde-Pj6AfgYMGOKu13kwA-sI
43
43
  modelbuilder/src/configmanager.py,sha256=Orwg_75Zk8Go_RdmFnEoKKRLJp6_2XZAtPRQZuD5Zmc,31937
44
44
  modelbuilder/src/csvcontentsmanager.py,sha256=25JbbbmgnebAkjr_RvItBBZXK8Cq66a4Lcea9bWqcdk,8258
45
45
  modelbuilder/src/csvwriter.py,sha256=2Xc6kdV6cYwCjrVF6WaZfS6tVp8-oc0ksIHSOx6iqj8,14132
46
- modelbuilder/src/fileanalyser.py,sha256=edcy8iyl0kGRuWApqA3339kz3bH8nYJ2PHD4w7edyrg,6711
46
+ modelbuilder/src/fileanalyser.py,sha256=G9-xJK_4ccj-1TJDag7x9hCpdPpQdaJO0MWUdFuCjkU,8047
47
47
  modelbuilder/src/filemanager.py,sha256=nfRQlW-AIp8ICu1CO0MO55OyWMWDQJrW4Z8yRRhBs-k,26454
48
48
  modelbuilder/src/messages.py,sha256=6JnW-ke6nHGUA4hTEBvo_kVlNJTXoV4LWw8mNwMpBCQ,1325
49
49
  modelbuilder/src/property.py,sha256=W67yx-vourlFDTsAcSgJOOlb4Q0exZFWf3gbNP2blJI,11615
@@ -88,8 +88,8 @@ regressiontests/eigeningenuity/historian-multi/test_getRawDatapoints.py,sha256=f
88
88
  regressiontests/eigeningenuity/historian-multi/test_listDataTags.py,sha256=TcceNSjCKoiK5SJcgTH2JXfKLYxIHdQdwZWlkpGnEVM,2006
89
89
  regressiontests/eigeningenuity/historian-multi/test_tagManagement.py,sha256=ylInBt453d1RaSih1eTTxGPZmb60UK4vMwI3UW-U1JY,4830
90
90
  regressiontests/eigeningenuity/historian-multi/test_writePoints.py,sha256=51tfUSLUqLKcCKJ1EyhjfzoC_4OP6n1oL3zgTSkXu4s,2696
91
- python_eigen_ingenuity-0.5.30b3.dist-info/METADATA,sha256=BadFVtYPUBR0rksSCT6nq8wwsUVATM-wf-Vgu3tWpVQ,8124
92
- python_eigen_ingenuity-0.5.30b3.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
93
- python_eigen_ingenuity-0.5.30b3.dist-info/entry_points.txt,sha256=G3LjFQX5xKaN4mqtqCL8uaC-gRbP5T5x9r0gBTJTXXA,70
94
- python_eigen_ingenuity-0.5.30b3.dist-info/top_level.txt,sha256=oDWOSmlNPKNBlIEKP8_JaV01O60jTcUIt2tDkq3OD18,56
95
- python_eigen_ingenuity-0.5.30b3.dist-info/RECORD,,
91
+ python_eigen_ingenuity-0.5.30b4.dist-info/METADATA,sha256=N50odrp3h5iJE7p6uIPKboyYQ7xd7pY8VaG7BqjLjME,8124
92
+ python_eigen_ingenuity-0.5.30b4.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
93
+ python_eigen_ingenuity-0.5.30b4.dist-info/entry_points.txt,sha256=G3LjFQX5xKaN4mqtqCL8uaC-gRbP5T5x9r0gBTJTXXA,70
94
+ python_eigen_ingenuity-0.5.30b4.dist-info/top_level.txt,sha256=oDWOSmlNPKNBlIEKP8_JaV01O60jTcUIt2tDkq3OD18,56
95
+ python_eigen_ingenuity-0.5.30b4.dist-info/RECORD,,