hlit 5.0.0__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.
- hlit-5.0.0/PKG-INFO +13 -0
- hlit-5.0.0/hlit.egg-info/PKG-INFO +13 -0
- hlit-5.0.0/hlit.egg-info/SOURCES.txt +60 -0
- hlit-5.0.0/hlit.egg-info/dependency_links.txt +1 -0
- hlit-5.0.0/hlit.egg-info/entry_points.txt +3 -0
- hlit-5.0.0/hlit.egg-info/namespace_packages.txt +1 -0
- hlit-5.0.0/hlit.egg-info/requires.txt +4 -0
- hlit-5.0.0/hlit.egg-info/top_level.txt +1 -0
- hlit-5.0.0/orangecontrib/HLIT/__init__.py +0 -0
- hlit-5.0.0/orangecontrib/HLIT/remote_server_smb/__init__.py +0 -0
- hlit-5.0.0/orangecontrib/HLIT/remote_server_smb/convert.py +233 -0
- hlit-5.0.0/orangecontrib/HLIT/remote_server_smb/hlit_workflow_management.py +662 -0
- hlit-5.0.0/orangecontrib/HLIT/remote_server_smb/management_workflow_sans_api.py +188 -0
- hlit-5.0.0/orangecontrib/HLIT/remote_server_smb/remote_purge.py +88 -0
- hlit-5.0.0/orangecontrib/HLIT/remote_server_smb/remote_script_launcher.py +67 -0
- hlit-5.0.0/orangecontrib/HLIT/remote_server_smb/server_uvicorn.py +1029 -0
- hlit-5.0.0/orangecontrib/HLIT/remote_server_smb/static/__init__.py +0 -0
- hlit-5.0.0/orangecontrib/HLIT/remote_server_smb/static/swagger/__init__.py +0 -0
- hlit-5.0.0/orangecontrib/HLIT/remote_server_smb/static/swagger/favicon.png +0 -0
- hlit-5.0.0/orangecontrib/HLIT/remote_server_smb/static/swagger/swagger-ui-bundle.js +2 -0
- hlit-5.0.0/orangecontrib/HLIT/remote_server_smb/static/swagger/swagger-ui-standalone-preset.js +2 -0
- hlit-5.0.0/orangecontrib/HLIT/remote_server_smb/static/swagger/swagger-ui.css +3 -0
- hlit-5.0.0/orangecontrib/HLIT/remote_server_smb/waiting_orderer_agent.py +88 -0
- hlit-5.0.0/orangecontrib/HLIT/utils/__init__.py +0 -0
- hlit-5.0.0/orangecontrib/HLIT/utils/daemonizer.py +139 -0
- hlit-5.0.0/orangecontrib/HLIT/utils/drag_drop_textEdit.py +27 -0
- hlit-5.0.0/orangecontrib/HLIT/utils/extract_property_ows.py +196 -0
- hlit-5.0.0/orangecontrib/HLIT/utils/hlit_python_api.py +908 -0
- hlit-5.0.0/orangecontrib/HLIT/utils/scheduler.py +490 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/OWAgentIA.py +326 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/OWCheckTable.py +224 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/OWInputInterface.py +235 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/OWLeTigre.py +1552 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/OWOutputInterface.py +133 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/OWStatutInterface.py +124 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/OW_ODM_loaded_finished.py +44 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/__init__.py +0 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/designer/ChatbotTigerODM.ui +1121 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/designer/CheckTable.ui +120 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/designer/Images/Tiger.png +0 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/designer/Images/delete.png +0 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/designer/Images/folder.png +0 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/designer/Images/model.png +0 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/designer/Images/new.png +0 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/designer/Images/paperclip.png +0 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/designer/Images/paperplane.png +0 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/designer/agent_ia.ui +196 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/designer/input_interface.ui +201 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/designer/output_interface.ui +110 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/designer/statut_interface.ui +133 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/icons/agent.png +0 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/icons/check_table.png +0 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/icons/input_interface.png +0 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/icons/output_interface.png +0 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/icons/statut.png +0 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/icons/tiger.png +0 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/icons/unlock.png +0 -0
- hlit-5.0.0/orangecontrib/HLIT/widgets/icons_dev/__init__.py +0 -0
- hlit-5.0.0/orangecontrib/__init__.py +1 -0
- hlit-5.0.0/setup.cfg +4 -0
- hlit-5.0.0/setup.py +70 -0
hlit-5.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hlit
|
|
3
|
+
Version: 5.0.0
|
|
4
|
+
Home-page:
|
|
5
|
+
Author:
|
|
6
|
+
Author-email:
|
|
7
|
+
Keywords: orange3 add-on
|
|
8
|
+
Requires-Dist: uvicorn
|
|
9
|
+
Requires-Dist: fastapi
|
|
10
|
+
Requires-Dist: CATEGORIT
|
|
11
|
+
Requires-Dist: schedule
|
|
12
|
+
Dynamic: keywords
|
|
13
|
+
Dynamic: requires-dist
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: hlit
|
|
3
|
+
Version: 5.0.0
|
|
4
|
+
Home-page:
|
|
5
|
+
Author:
|
|
6
|
+
Author-email:
|
|
7
|
+
Keywords: orange3 add-on
|
|
8
|
+
Requires-Dist: uvicorn
|
|
9
|
+
Requires-Dist: fastapi
|
|
10
|
+
Requires-Dist: CATEGORIT
|
|
11
|
+
Requires-Dist: schedule
|
|
12
|
+
Dynamic: keywords
|
|
13
|
+
Dynamic: requires-dist
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
setup.py
|
|
2
|
+
hlit.egg-info/PKG-INFO
|
|
3
|
+
hlit.egg-info/SOURCES.txt
|
|
4
|
+
hlit.egg-info/dependency_links.txt
|
|
5
|
+
hlit.egg-info/entry_points.txt
|
|
6
|
+
hlit.egg-info/namespace_packages.txt
|
|
7
|
+
hlit.egg-info/requires.txt
|
|
8
|
+
hlit.egg-info/top_level.txt
|
|
9
|
+
orangecontrib/__init__.py
|
|
10
|
+
orangecontrib/HLIT/__init__.py
|
|
11
|
+
orangecontrib/HLIT/remote_server_smb/__init__.py
|
|
12
|
+
orangecontrib/HLIT/remote_server_smb/convert.py
|
|
13
|
+
orangecontrib/HLIT/remote_server_smb/hlit_workflow_management.py
|
|
14
|
+
orangecontrib/HLIT/remote_server_smb/management_workflow_sans_api.py
|
|
15
|
+
orangecontrib/HLIT/remote_server_smb/remote_purge.py
|
|
16
|
+
orangecontrib/HLIT/remote_server_smb/remote_script_launcher.py
|
|
17
|
+
orangecontrib/HLIT/remote_server_smb/server_uvicorn.py
|
|
18
|
+
orangecontrib/HLIT/remote_server_smb/waiting_orderer_agent.py
|
|
19
|
+
orangecontrib/HLIT/remote_server_smb/static/__init__.py
|
|
20
|
+
orangecontrib/HLIT/remote_server_smb/static/swagger/__init__.py
|
|
21
|
+
orangecontrib/HLIT/utils/__init__.py
|
|
22
|
+
orangecontrib/HLIT/utils/daemonizer.py
|
|
23
|
+
orangecontrib/HLIT/utils/drag_drop_textEdit.py
|
|
24
|
+
orangecontrib/HLIT/utils/extract_property_ows.py
|
|
25
|
+
orangecontrib/HLIT/utils/hlit_python_api.py
|
|
26
|
+
orangecontrib/HLIT/utils/scheduler.py
|
|
27
|
+
orangecontrib/HLIT/widgets/OWAgentIA.py
|
|
28
|
+
orangecontrib/HLIT/widgets/OWCheckTable.py
|
|
29
|
+
orangecontrib/HLIT/widgets/OWInputInterface.py
|
|
30
|
+
orangecontrib/HLIT/widgets/OWLeTigre.py
|
|
31
|
+
orangecontrib/HLIT/widgets/OWOutputInterface.py
|
|
32
|
+
orangecontrib/HLIT/widgets/OWStatutInterface.py
|
|
33
|
+
orangecontrib/HLIT/widgets/OW_ODM_loaded_finished.py
|
|
34
|
+
orangecontrib/HLIT/widgets/__init__.py
|
|
35
|
+
orangecontrib/HLIT/widgets/../remote_server_smb/static/swagger/__init__.py
|
|
36
|
+
orangecontrib/HLIT/widgets/../remote_server_smb/static/swagger/favicon.png
|
|
37
|
+
orangecontrib/HLIT/widgets/../remote_server_smb/static/swagger/swagger-ui-bundle.js
|
|
38
|
+
orangecontrib/HLIT/widgets/../remote_server_smb/static/swagger/swagger-ui-standalone-preset.js
|
|
39
|
+
orangecontrib/HLIT/widgets/../remote_server_smb/static/swagger/swagger-ui.css
|
|
40
|
+
orangecontrib/HLIT/widgets/designer/ChatbotTigerODM.ui
|
|
41
|
+
orangecontrib/HLIT/widgets/designer/CheckTable.ui
|
|
42
|
+
orangecontrib/HLIT/widgets/designer/agent_ia.ui
|
|
43
|
+
orangecontrib/HLIT/widgets/designer/input_interface.ui
|
|
44
|
+
orangecontrib/HLIT/widgets/designer/output_interface.ui
|
|
45
|
+
orangecontrib/HLIT/widgets/designer/statut_interface.ui
|
|
46
|
+
orangecontrib/HLIT/widgets/designer/Images/Tiger.png
|
|
47
|
+
orangecontrib/HLIT/widgets/designer/Images/delete.png
|
|
48
|
+
orangecontrib/HLIT/widgets/designer/Images/folder.png
|
|
49
|
+
orangecontrib/HLIT/widgets/designer/Images/model.png
|
|
50
|
+
orangecontrib/HLIT/widgets/designer/Images/new.png
|
|
51
|
+
orangecontrib/HLIT/widgets/designer/Images/paperclip.png
|
|
52
|
+
orangecontrib/HLIT/widgets/designer/Images/paperplane.png
|
|
53
|
+
orangecontrib/HLIT/widgets/icons/agent.png
|
|
54
|
+
orangecontrib/HLIT/widgets/icons/check_table.png
|
|
55
|
+
orangecontrib/HLIT/widgets/icons/input_interface.png
|
|
56
|
+
orangecontrib/HLIT/widgets/icons/output_interface.png
|
|
57
|
+
orangecontrib/HLIT/widgets/icons/statut.png
|
|
58
|
+
orangecontrib/HLIT/widgets/icons/tiger.png
|
|
59
|
+
orangecontrib/HLIT/widgets/icons/unlock.png
|
|
60
|
+
orangecontrib/HLIT/widgets/icons_dev/__init__.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
orangecontrib
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
orangecontrib
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
import json
|
|
2
|
+
import Orange
|
|
3
|
+
from Orange.data import Table, Domain, StringVariable, ContinuousVariable
|
|
4
|
+
import math
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def is_valid_json_string(data):
|
|
8
|
+
try:
|
|
9
|
+
json_str = json.dumps(data)
|
|
10
|
+
json.loads(json_str)
|
|
11
|
+
return 0
|
|
12
|
+
except json.JSONDecodeError:
|
|
13
|
+
return 1
|
|
14
|
+
|
|
15
|
+
def convert_json_to_orange_data_table(json_data):
|
|
16
|
+
"""
|
|
17
|
+
Convertit une liste de dictionnaires JSON en un objet de données de type data table sous Orange data Mining (.tab)
|
|
18
|
+
Exemple de json_data qui peut etre utilisé pour cette fonction :
|
|
19
|
+
{"ows_path": "toto.ows", "front_id": "11OO1O1O1", "data": [{"num_input": 0, "values": [["col1", "col2", "col3"], ["float", "str", "float"], [[3, "test", 6], [4, "oui", 5]]]}]}
|
|
20
|
+
|
|
21
|
+
:param json_data: Chaine json au format d'exemple
|
|
22
|
+
:return: Data Table.
|
|
23
|
+
"""
|
|
24
|
+
if is_valid_json_string(json_data) == 1:
|
|
25
|
+
print("La data n'est pas au format json")
|
|
26
|
+
return 1
|
|
27
|
+
json_str = json.dumps(json_data)
|
|
28
|
+
data = json.loads(json_str)
|
|
29
|
+
domain = []
|
|
30
|
+
data_continous = []
|
|
31
|
+
data_metas = []
|
|
32
|
+
table = []
|
|
33
|
+
attributes = []
|
|
34
|
+
metas = []
|
|
35
|
+
for i, d in enumerate(data["values"][1]):
|
|
36
|
+
if d == "str":
|
|
37
|
+
metas.append(StringVariable(data["values"][0][i]))
|
|
38
|
+
if d == "float":
|
|
39
|
+
attributes.append(ContinuousVariable(data["values"][0][i]))
|
|
40
|
+
for elem in data["values"][2]:
|
|
41
|
+
if len(elem) != len(data["values"][1]):
|
|
42
|
+
print("Il manque des données par rapport au nombre de colonnes")
|
|
43
|
+
return 1
|
|
44
|
+
d_metas = []
|
|
45
|
+
d_continous = []
|
|
46
|
+
for i, d in enumerate(data["values"][1]):
|
|
47
|
+
if d == "str":
|
|
48
|
+
d_metas.append(elem[i])
|
|
49
|
+
if d == "float":
|
|
50
|
+
d_continous.append(elem[i])
|
|
51
|
+
data_metas.append(d_metas)
|
|
52
|
+
data_continous.append(d_continous)
|
|
53
|
+
domain = Domain(attributes, metas=metas)
|
|
54
|
+
table = Table.from_numpy(domain, data_continous, metas=data_metas)
|
|
55
|
+
return table
|
|
56
|
+
|
|
57
|
+
def safe_val(val):
|
|
58
|
+
return "" if isinstance(val, float) and math.isnan(val) else val
|
|
59
|
+
|
|
60
|
+
def convert_data_table_to_json(data):
|
|
61
|
+
"""
|
|
62
|
+
Convertit un objet de données de type data table sous Orange data Mining (.tab) en une liste de dictionnaires JSON.
|
|
63
|
+
|
|
64
|
+
:param data: Objet contenant les données avec ses attributs et métadonnées.
|
|
65
|
+
:return: Chaîne JSON formatée. None si erreur
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
if data == None or data == []:
|
|
69
|
+
print("Pas de data en entree")
|
|
70
|
+
return None
|
|
71
|
+
feature_names = [var.name for var in data.domain.attributes]
|
|
72
|
+
meta_names = [var.name for var in data.domain.metas]
|
|
73
|
+
json_data = []
|
|
74
|
+
for row in data:
|
|
75
|
+
row_dict = {}
|
|
76
|
+
for i, col in enumerate(feature_names):
|
|
77
|
+
row_dict[col] = safe_val(row[i].value)
|
|
78
|
+
for i, col in enumerate(meta_names):
|
|
79
|
+
row_dict[col] = safe_val(row.metas[i])
|
|
80
|
+
# Vérifier si la ligne contient uniquement des types (ex: "continuous", "discrete")
|
|
81
|
+
if all(isinstance(value, str) and value in ["continuous", "discrete"] for value in row_dict.values()):
|
|
82
|
+
continue # Ignorer cette ligne
|
|
83
|
+
json_data.append(row_dict)
|
|
84
|
+
return json_data
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def json_explicite_to_implicite(json_data):
|
|
88
|
+
# json data du type {'num_input': 0, 'values': [['col1', 'col2', 'col3'], ['float', 'str', 'float'], [[3, 'test', 6], [4, 'oui', 5]]]}
|
|
89
|
+
table = convert_json_to_orange_data_table(json_data)
|
|
90
|
+
if table == 1:
|
|
91
|
+
print("erreur dans convert_json_to_orange_data_table")
|
|
92
|
+
return None
|
|
93
|
+
json = convert_data_table_to_json(table)
|
|
94
|
+
if json == None:
|
|
95
|
+
print("erreur dans convert_data_table_to_json")
|
|
96
|
+
return None
|
|
97
|
+
return json
|
|
98
|
+
|
|
99
|
+
def json_implicite_to_explicite(json_data):
|
|
100
|
+
print("a faire")
|
|
101
|
+
|
|
102
|
+
def is_explicite(json_data):
|
|
103
|
+
if is_valid_json_string(json_data) == 1:
|
|
104
|
+
print("La data n'est pas au format json")
|
|
105
|
+
return 1
|
|
106
|
+
if 'values' in json_data and isinstance(json_data['values'], list) and len(json_data['values']) == 3:
|
|
107
|
+
if isinstance(json_data['values'][0], list) and isinstance(json_data['values'][1], list) and isinstance(json_data['values'][2], list):
|
|
108
|
+
return 0
|
|
109
|
+
return 1
|
|
110
|
+
|
|
111
|
+
def is_implicite(json_data):
|
|
112
|
+
if is_valid_json_string(json_data) == 1:
|
|
113
|
+
print("La data n'est pas au format json")
|
|
114
|
+
return 1
|
|
115
|
+
if not isinstance(json_data, list):
|
|
116
|
+
return 1
|
|
117
|
+
for i, element in enumerate(json_data):
|
|
118
|
+
if not isinstance(element, dict):
|
|
119
|
+
return f"L'élément à l'index {i} n'est pas un dictionnaire."
|
|
120
|
+
cles_reference = set(json_data[0].keys())
|
|
121
|
+
for i, d in enumerate(json_data[1:], start=2):
|
|
122
|
+
cles_actuelles = set(d.keys())
|
|
123
|
+
if cles_actuelles != cles_reference:
|
|
124
|
+
print(
|
|
125
|
+
f"Le dictionnaire #{i} n'a pas les mêmes clés. Clés attendues : {cles_reference}, trouvées : {cles_actuelles}")
|
|
126
|
+
return 1
|
|
127
|
+
return 0
|
|
128
|
+
|
|
129
|
+
def is_implicite_or_explicite(json_data):
|
|
130
|
+
if is_implicite(json_data) == 0:
|
|
131
|
+
print("implicite")
|
|
132
|
+
return
|
|
133
|
+
if is_explicite(json_data) == 0:
|
|
134
|
+
print("explicite")
|
|
135
|
+
return
|
|
136
|
+
|
|
137
|
+
# Fonction pour traduire Orange types en types Python
|
|
138
|
+
def orange_var_type_to_python(var):
|
|
139
|
+
if var.is_string:
|
|
140
|
+
return "str"
|
|
141
|
+
if var.is_continuous:
|
|
142
|
+
return "float"
|
|
143
|
+
|
|
144
|
+
def convert_data_table_to_json_explicite(data, num_input=None):
|
|
145
|
+
if data == None or data == []:
|
|
146
|
+
print("Pas de data en entree")
|
|
147
|
+
return None
|
|
148
|
+
|
|
149
|
+
feature_names = [var.name for var in data.domain.attributes]
|
|
150
|
+
meta_names = [var.name for var in data.domain.metas]
|
|
151
|
+
|
|
152
|
+
feature_types = [orange_var_type_to_python(var) for var in data.domain.attributes]
|
|
153
|
+
meta_types = [orange_var_type_to_python(var) for var in data.domain.metas]
|
|
154
|
+
|
|
155
|
+
if len(feature_names) != len(feature_types) or len(meta_names) != len(meta_types):
|
|
156
|
+
print("Il manque des données par rapport au nombre de colonnes")
|
|
157
|
+
return None
|
|
158
|
+
|
|
159
|
+
new_data = []
|
|
160
|
+
for i in range(len(data)):
|
|
161
|
+
d = []
|
|
162
|
+
for j in range(len(feature_names)):
|
|
163
|
+
if data[i][j] is None or (isinstance(data[i][j].value, float) and math.isnan(data[i][j].value)):
|
|
164
|
+
d.append(None)
|
|
165
|
+
else:
|
|
166
|
+
d.append(data[i][j].value)
|
|
167
|
+
for j in range(len(data[i].metas)):
|
|
168
|
+
if data[i].metas[j] is None:
|
|
169
|
+
d.append("")
|
|
170
|
+
else:
|
|
171
|
+
d.append(str(data[i].metas[j]))
|
|
172
|
+
new_data.append(d)
|
|
173
|
+
json_data = {'num_input': num_input, 'values': [feature_names + meta_names, feature_types+meta_types, new_data]}
|
|
174
|
+
return json_data
|
|
175
|
+
|
|
176
|
+
def convert_json_implicite_to_data_table(json_data):
|
|
177
|
+
if is_implicite(json_data) == 1:
|
|
178
|
+
print("La data n'est pas au format implicite")
|
|
179
|
+
return None
|
|
180
|
+
attributes = []
|
|
181
|
+
metas = []
|
|
182
|
+
for item in json_data:
|
|
183
|
+
for key, value in item.items():
|
|
184
|
+
if isinstance(value, str):
|
|
185
|
+
metas.append(key)
|
|
186
|
+
elif isinstance(value, float) or isinstance(value, int):
|
|
187
|
+
attributes.append(key)
|
|
188
|
+
break
|
|
189
|
+
domain_attributes = []
|
|
190
|
+
domain_metas = []
|
|
191
|
+
data_continous = []
|
|
192
|
+
data_metas = []
|
|
193
|
+
for item in json_data:
|
|
194
|
+
d = []
|
|
195
|
+
m = []
|
|
196
|
+
for key, value in item.items():
|
|
197
|
+
if key in metas:
|
|
198
|
+
m.append(value)
|
|
199
|
+
elif key in attributes:
|
|
200
|
+
if value is None or isinstance(value, str):
|
|
201
|
+
d.append(None)
|
|
202
|
+
else:
|
|
203
|
+
if hasattr(value, "value"):
|
|
204
|
+
value = value.value
|
|
205
|
+
if value is None or isinstance(value, int):
|
|
206
|
+
d.append(int(value))
|
|
207
|
+
elif value is None or isinstance(value, float):
|
|
208
|
+
d.append(float(value))
|
|
209
|
+
data_continous.append(d)
|
|
210
|
+
data_metas.append(m)
|
|
211
|
+
for i in range(len(attributes)):
|
|
212
|
+
domain_attributes.append(ContinuousVariable(attributes[i]))
|
|
213
|
+
for i in range(len(metas)):
|
|
214
|
+
domain_metas.append(StringVariable(metas[i]))
|
|
215
|
+
domain = Domain(domain_attributes, metas=domain_metas)
|
|
216
|
+
table = Table.from_numpy(domain, data_continous, metas=data_metas)
|
|
217
|
+
return table
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
if __name__ == "__main__":
|
|
221
|
+
#json_data = {'num_input': 0, 'values': [['col1', 'col2', 'col3'],['float', 'str', 'float'], [[3, 'test', 6], [4, 'oui', 5]]]} # explicite
|
|
222
|
+
json_data = [{'nom': 'Alice', 'age': 30}, {'nom': 'Bob', 'age': 25}, {'nom': 'Bob', 'age': 25}] # implicite
|
|
223
|
+
#is_implicite_or_explicite(json_data)
|
|
224
|
+
table = convert_json_implicite_to_data_table(json_data)
|
|
225
|
+
print(table)
|
|
226
|
+
#table = convert_json_to_orange_data_table(json_data)
|
|
227
|
+
exit(0)
|
|
228
|
+
data = Orange.data.Table("table_data.tab")
|
|
229
|
+
print("data table entrée : ",data)
|
|
230
|
+
json_ex = convert_data_table_to_json_explicite(data)
|
|
231
|
+
print("json explicite : ",json_ex)
|
|
232
|
+
|
|
233
|
+
|