python-eigen-ingenuity 0.5.9b4__py3-none-any.whl → 0.5.10__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.
@@ -63,8 +63,8 @@ def _convert_sys_argv_(func):
63
63
  @_convert_sys_argv_
64
64
  def build(path:str='.', config:str='config.ini', configsection:str='', file:str='', query:list=[], preprocess:list=[], postprocess:list=[], delete_all:list=[], separator:str=';',
65
65
  start_from:int=1, end_at:int=1, no_versions:bool=False, no_system_properties:bool=False, ignore_nodes:bool=False, skip_duplicates:bool=False,
66
- no_duplicates:bool=False, allow_blanks:list=[], batch:int=0, auth:bool=False, order:str='qnrc', filetypes:str='qnrc', primary_property:str='', required_labels:list=[],
67
- required_properties:list=[], database:str='0', verify:bool=False, summarise:bool=False, show_queries:bool=False, show_returns:bool=False,
66
+ no_duplicates:bool=False, allow_blanks:list=[], replace_blanks:str='', batch:int=0, auth:bool=False, order:str='qnrc', filetypes:str='qnrc', primary_property:str='',
67
+ required_labels:list=[], required_properties:list=[], database:str='0', verify:bool=False, summarise:bool=False, show_queries:bool=False, show_returns:bool=False,
68
68
  write_queries:str='', write_returns:str='', display_rate='auto', create_node_csv_file:bool=False, node_labels:list=[], node_properties:list=[],
69
69
  csv_file_suffix:str='', create_relationship_csv_file:bool=False, csv_to_labels:list=[], csv_to_properties:str=''):
70
70
  """The main model builder tools, features a suite of options that allow for importing, exporting, building and updating neo4j data models
@@ -90,6 +90,7 @@ def build(path:str='.', config:str='config.ini', configsection:str='', file:str=
90
90
  ignore_nodes: Treat node columns in relationship files as relationship properties
91
91
  skip_duplicates: Don't create a version node if there are no changes. Same as -nod
92
92
  allow_blanks: List of properties to create even if blank
93
+ replace_blanks: Used in combination with allowblanks. Write a specific value instead of blank e.g "__NULL"
93
94
  batch: Number of queries to batch together when processing a node .csv file, significantly improves performance
94
95
  auth: Enable Azure Authentication
95
96
  order: Order in which to process the input files. Default is qnrc
@@ -124,11 +124,11 @@ class CSVContentsManager:
124
124
  properties_list = [Neo4jProperty(self.mapped_keys[column], this_row[column], self.formats[column]) for column in column_numbers if len(this_row[column])]
125
125
  return properties_list
126
126
 
127
- def get_property_values_dict(self, row_number, column_numbers, allow_blank_property_list, default_key='', prefix=''):
127
+ def get_property_values_dict(self, row_number, column_numbers, allow_blank_property_list, default_key='', prefix='', blank_override=''):
128
128
  this_row = self.data_list[row_number]
129
129
  split_values = [this_row[column].split('::') for column in column_numbers]
130
130
  split_keys = [(split_values[count][0] + ':').split(':') for count, column in enumerate(column_numbers)]
131
- this_list = {prefix + (self.mapped_keys[column] or default_key): Neo4jProperty(prefix + (self.mapped_keys[column] or default_key), this_row[column], self.formats[column]) if len(split_values[count]) == 1 else {prefix + (split_keys[count][0] or default_key): Neo4jProperty(prefix + (split_keys[count][0] or default_key), split_values[count][1], split_keys[count][1] or self.formats[column])} for count, column in enumerate(column_numbers) if this_row[column] or self.mapped_keys[column] in allow_blank_property_list or allow_blank_property_list == []}
131
+ this_list = {prefix + (self.mapped_keys[column] or default_key): Neo4jProperty(prefix + (self.mapped_keys[column] or default_key), this_row[column], self.formats[column], blank_override=blank_override) if len(split_values[count]) == 1 else {prefix + (split_keys[count][0] or default_key): Neo4jProperty(prefix + (split_keys[count][0] or default_key), split_values[count][1], split_keys[count][1] or self.formats[column], blank_override=blank_override)} for count, column in enumerate(column_numbers) if this_row[column] or self.mapped_keys[column] in allow_blank_property_list or allow_blank_property_list == []}
132
132
  return this_list
133
133
 
134
134
  def get_property_values_list(self, row_number, column_numbers, default_key='', override_key=''):
@@ -71,7 +71,7 @@ class NodeFileProcessor:
71
71
  while this_row < last_row:
72
72
  validated_csv_labels = lm.validate_labels(self.contents.get_column_values_list(this_row, label_columns))
73
73
  merge_labels, new_labels, remove_labels = lm.sort_node_labels(self.required_labels, validated_csv_labels)
74
- row_properties = self.contents.get_property_values_dict(this_row, property_columns, self.blank_property_list, self.blank_property_override)
74
+ row_properties = self.contents.get_property_values_dict(this_row, property_columns, self.blank_property_list, blank_override=self.blank_property_override)
75
75
  properties = pm.combine_properties(self.required_properties, row_properties)
76
76
  # Remove any properties we don't want
77
77
  for unwanted in self.unrequired_properties:
@@ -158,7 +158,7 @@ class NodeFileProcessor:
158
158
  while this_row < last_row:
159
159
  validated_csv_labels = lm.validate_labels(self.contents.get_column_values_list(this_row, label_columns))
160
160
  merge_labels, new_labels, remove_labels = lm.sort_node_labels(self.required_labels, validated_csv_labels)
161
- row_properties = self.contents.get_property_values_dict(this_row, property_columns, self.blank_property_list, self.blank_property_override)
161
+ row_properties = self.contents.get_property_values_dict(this_row, property_columns, self.blank_property_list, blank_override=self.blank_property_override)
162
162
 
163
163
  for primary_property in self.contents.get_property_values_list(this_row, node_columns, self.primary_property):
164
164
  properties = pm.combine_properties(self.required_properties, row_properties)
@@ -78,7 +78,7 @@ class RelationshipFileProcessor:
78
78
 
79
79
  relationships = rm.validate_relationships(self.contents.get_column_values_list(this_row, relation_columns))
80
80
 
81
- properties = self.contents.get_property_values_dict(this_row, property_columns, self.blank_property_list, self.blank_property_override)
81
+ properties = self.contents.get_property_values_dict(this_row, property_columns, self.blank_property_list, blank_override=self.blank_property_override)
82
82
  # If there are multiple From or To nodes, create a relationship query for each combination
83
83
  for from_node in self.contents.get_property_values_list(this_row, from_columns, self.primary_property, self.primary_property):
84
84
  validated_csv_from_labels = lm.validate_labels(self.contents.get_column_values_list(this_row, from_label_columns))
@@ -165,7 +165,7 @@ class RelationshipFileProcessor:
165
165
  last_row = self.get_last_row(num_data_rows)
166
166
  while this_row < last_row:
167
167
  relationships = rm.validate_relationships(self.contents.get_column_values_list(this_row, relation_columns))
168
- properties = self.contents.get_property_values_dict(this_row, property_columns, self.blank_property_list, self.blank_property_override)
168
+ properties = self.contents.get_property_values_dict(this_row, property_columns, self.blank_property_list, blank_override=self.blank_property_override)
169
169
  # If there are multiple From or To nodes, create a relationship query for each combination
170
170
  for from_node in self.contents.get_property_values_list(this_row, from_columns, self.primary_property, self.primary_property):
171
171
  validated_csv_from_labels = lm.validate_labels(self.contents.get_column_values_list(this_row, from_label_columns))
@@ -7,11 +7,6 @@ class Neo4jProperty():
7
7
 
8
8
  def __init__(self, key, value = None, format = None, type = None, blank_override = False):
9
9
 
10
- # print(f'k: {key}')
11
- # print(f'f: {format}')
12
- # print(f'v: {value}')
13
- # print(f't: {type}')
14
-
15
10
  self.key = pm.validate_property(key)
16
11
  # Sanitise the value
17
12
  self.value = value.replace('\\', '\\\\').replace('\r', '\\r').replace('\n', '\\n').replace('"', '\\"')
@@ -19,9 +14,7 @@ class Neo4jProperty():
19
14
  if self.value == "":
20
15
  if blank_override:
21
16
  self.value = blank_override
22
- else:
23
- self.value = "''"
24
-
17
+
25
18
  # format is the data type e.g. int, str, bool
26
19
  self.format = format
27
20
  # type is the kind of thing this is, such as ID, START_ID etc. See assetmodelutilities.py for the full list
@@ -157,33 +150,32 @@ def format_value(self, ref):
157
150
  data_type = 'str'
158
151
  self.format = 'str'
159
152
 
160
- if value:
161
- match str(data_type):
162
- case 'str':
163
- result = quote + (formula or value) + quote
164
- case "<class 'int'>":
165
- if value != '0' and value.startswith('0'):
166
- # Has a leading 0, so treat as a string
167
- result = quote + value + quote
168
- else:
169
- result = int(ast.literal_eval(value))
170
- if result != ast.literal_eval(value):
171
- messages.warning_message('Invalid data: ', f'{value} is not a valid Integer, {result} used instead')
172
- self.format = 'int'
173
- case "<class 'float'>":
174
- result = ast.literal_eval(value)
175
- self.format = 'float'
176
- case "<class 'bool'>":
177
- # result already set above, so
178
- pass
179
- case 'date' | 'datetime':
180
- # result already set above, so
181
- pass
182
- case "<class 'list'>":
183
- result = value
184
- case _:
185
- # Shouldn't get here, but just in case use a string
153
+ match str(data_type):
154
+ case 'str':
155
+ result = quote + (formula or value) + quote
156
+ case "<class 'int'>":
157
+ if value != '0' and value.startswith('0'):
158
+ # Has a leading 0, so treat as a string
186
159
  result = quote + value + quote
160
+ else:
161
+ result = int(ast.literal_eval(value))
162
+ if result != ast.literal_eval(value):
163
+ messages.warning_message('Invalid data: ', f'{value} is not a valid Integer, {result} used instead')
164
+ self.format = 'int'
165
+ case "<class 'float'>":
166
+ result = ast.literal_eval(value)
167
+ self.format = 'float'
168
+ case "<class 'bool'>":
169
+ # result already set above, so
170
+ pass
171
+ case 'date' | 'datetime':
172
+ # result already set above, so
173
+ pass
174
+ case "<class 'list'>":
175
+ result = value
176
+ case _:
177
+ # Shouldn't get here, but just in case use a string
178
+ result = quote + value + quote
187
179
 
188
180
  case _:
189
181
  # Treat unsupported formats as strings
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-eigen-ingenuity
3
- Version: 0.5.9b4
3
+ Version: 0.5.10
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
@@ -12,16 +12,16 @@ eigeningenuity/util.py,sha256=G29hwukPvaq66RYpDThCY9mEB3jili6i5BaxV4-Rmwc,18593
12
12
  eigeningenuity/core/__init__.py,sha256=wIFyRpfPzwi5_ALu0icdE3lxlMZgUrZ7y4o69XpVusw,8685
13
13
  modelbuilder/__init__.py,sha256=HSsHItu5BbGQiHYTG00QPMNDbC3RkRUaaN50YpksIUA,171
14
14
  modelbuilder/src/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
15
- modelbuilder/src/assetmodelbuilder.py,sha256=TtIkaPXoe7uSdBg3H67ZsJsjuWEiZJGHXNpEgjX_IXE,8256
15
+ modelbuilder/src/assetmodelbuilder.py,sha256=sJa2rc33WxkVPXuLnk8HBulApc-DphD67mt2lTOubaU,8398
16
16
  modelbuilder/src/assetmodelcsvwriter.py,sha256=GKNi_fw7AlY-UG2XhwFIS34Ff3XiVRss-o5MUzyJSV0,1071
17
17
  modelbuilder/src/assetmodelutilities.py,sha256=KwyP8-2EfpRHKmGasPJLV74EGYBjSHgxHBAy8xuvh6k,1743
18
18
  modelbuilder/src/configmanager.py,sha256=WWg6XHmBYBoQkDJ7ZcLWe1uX93trULe1xjXetcxMKMY,25021
19
- modelbuilder/src/csvcontentsmanager.py,sha256=_JpgJw65o2no5jGfJsfSdCVX88OIIX6NZQFTYcveJ54,6927
19
+ modelbuilder/src/csvcontentsmanager.py,sha256=0HXo1JtnsZ355YpfO66tkQGkcqVLFEUFmf5-B-VcnGU,7008
20
20
  modelbuilder/src/csvwriter.py,sha256=m2XVbyZq3Gq2bb36HqvOFuTuet1fi1nRPURL6yEtfjI,14051
21
21
  modelbuilder/src/fileanalyser.py,sha256=yz7WFIMmeZ2Oh1SFGmdIzl9p8rflOrx3xoEUp5bESD4,3781
22
22
  modelbuilder/src/filemanager.py,sha256=dFSVc7ciI9EfViyk6z2WmWMDTIvLJgVSU9XRsqTNfxg,22021
23
23
  modelbuilder/src/messages.py,sha256=6JnW-ke6nHGUA4hTEBvo_kVlNJTXoV4LWw8mNwMpBCQ,1325
24
- modelbuilder/src/property.py,sha256=XCXHlBiEUa4U0rZnrNHqFmzrpiiGCeMjKQtS2qgiuWI,12201
24
+ modelbuilder/src/property.py,sha256=SEy9xeLqUsy1q1RUef8K_5IaclPzXTk1c07j76xDnXA,11886
25
25
  modelbuilder/src/versionmanager.py,sha256=SRbhre0VH3Z8d-S1rbMjLauYvzydNY6v_glM0nQarPI,19272
26
26
  modelbuilder/src/connectors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
27
27
  modelbuilder/src/connectors/boltconnector.py,sha256=N4hNEXzRWkPgDrRi49tgUdYw_y4ODu-mZUS3AiYAH7k,4579
@@ -31,16 +31,16 @@ modelbuilder/src/connectors/httpsconnector.py,sha256=06TrQSEa5bmqXjPPAqz1hXrOEOw
31
31
  modelbuilder/src/processors/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
32
  modelbuilder/src/processors/cypherfileprocessor.py,sha256=Y77GddRVhQKNhs6V4jfqwE2LhZvINZ1NX0a_lRadlds,2868
33
33
  modelbuilder/src/processors/labelmanager.py,sha256=03fD-JXjdeEyHXUeihst5rVWgmd-3-Y8fSMM42OfsT8,6237
34
- modelbuilder/src/processors/nodefileprocessor.py,sha256=zxihfH3fIqIBJe__pICcwc7NjEBzDBxQfWWG87MZCHk,13626
34
+ modelbuilder/src/processors/nodefileprocessor.py,sha256=rz4R3Dv7ZufTg8J7Z62H_B038FabnuH9BBKCa6qsXaw,13656
35
35
  modelbuilder/src/processors/propertymanager.py,sha256=8l9Wc3hirdiTLsrGNXzxWGn-D3z7yHRtJDVKIfQtc-8,6633
36
- modelbuilder/src/processors/relationshipfileprocessor.py,sha256=Ym4KzvyFwFuUUjFHIAHmLzAfb2OElxxILg6ZZN8jeIM,15611
36
+ modelbuilder/src/processors/relationshipfileprocessor.py,sha256=a5kMeMcxkQImMJS8lliWQYTUoGDAi1ghBUj4yayE4V8,15641
37
37
  modelbuilder/src/processors/relationshipmanager.py,sha256=lDtE_5AdKzL3boq7VD8Gmpai8Uscq79vRxkzYQL8A9A,1105
38
38
  modelbuilder/src/queries/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
39
39
  modelbuilder/src/queries/cypherbuilder.py,sha256=_CIb2eQSa1N23m3ebzoCF-W9DPvKoRHAIF9wyt1EuV4,10715
40
40
  modelbuilder/src/queries/query.py,sha256=fEkGv49yxeL0Sz5bMmC3-Dt0_9qoZBz37hsTY8pQVIA,2568
41
41
  modelbuilder/src/queries/typedefs.py,sha256=JebIVlrLHylhisziGgG2YOJcTapT2tyVc3PsqeHw0RU,10437
42
- python_eigen_ingenuity-0.5.9b4.dist-info/METADATA,sha256=4I6cEkk24Ik-kLnc6uMLbO-btJIbOQJWTvCWW1JQZZ4,38188
43
- python_eigen_ingenuity-0.5.9b4.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
44
- python_eigen_ingenuity-0.5.9b4.dist-info/entry_points.txt,sha256=G3LjFQX5xKaN4mqtqCL8uaC-gRbP5T5x9r0gBTJTXXA,70
45
- python_eigen_ingenuity-0.5.9b4.dist-info/top_level.txt,sha256=lFiZ43CY_1bmdtRidIXbA6rrY2d92Rs-9tH8pcgI-XU,28
46
- python_eigen_ingenuity-0.5.9b4.dist-info/RECORD,,
42
+ python_eigen_ingenuity-0.5.10.dist-info/METADATA,sha256=47oofn7nI4vaoeQgVGovim8KQlwnc3kNQ54SXykKs1Q,38187
43
+ python_eigen_ingenuity-0.5.10.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
44
+ python_eigen_ingenuity-0.5.10.dist-info/entry_points.txt,sha256=G3LjFQX5xKaN4mqtqCL8uaC-gRbP5T5x9r0gBTJTXXA,70
45
+ python_eigen_ingenuity-0.5.10.dist-info/top_level.txt,sha256=lFiZ43CY_1bmdtRidIXbA6rrY2d92Rs-9tH8pcgI-XU,28
46
+ python_eigen_ingenuity-0.5.10.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (74.1.2)
2
+ Generator: setuptools (75.6.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5