Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1326,23 +1326,9 @@ def load_from_stats(n_clicks, array_value, theme):
|
|
1326 |
}
|
1327 |
children = []
|
1328 |
children_tabs = []
|
1329 |
-
for
|
1330 |
-
table = datavisualisation_chiffres_cles_emplois("https://dataemploi.pole-emploi.fr/metier/chiffres-cles/NAT/FR/" +
|
1331 |
-
|
1332 |
-
response = requests.get("https://dataemploi.pole-emploi.fr/metier/chiffres-cles/NAT/FR/" + array_value[j])
|
1333 |
-
soup = BeautifulSoup(response.text, "html.parser")
|
1334 |
-
allembauches = soup.select('p.population_category')
|
1335 |
-
allnumembauchesfirst = soup.select('p.population_main-num.data')
|
1336 |
-
if removeTags(allnumembauchesfirst[0]).find('\xa0') != -1:
|
1337 |
-
allnumembauches = removeTags(allnumembauchesfirst[0]).split('\xa0')
|
1338 |
-
allnumembauches = ''.join(allnumembauches)
|
1339 |
-
allnumembauches = allnumembauches.replace(" ","").strip()
|
1340 |
-
else:
|
1341 |
-
allnumembauches = removeTags(allnumembauchesfirst[0]).replace(" ","").strip()
|
1342 |
-
|
1343 |
-
print("Le code HTML est : " + soup)
|
1344 |
-
print("Le nombre d'embauches : " + allnumembauches)
|
1345 |
-
array_label_rome = searchByRome(array_value[j])
|
1346 |
df_demandeur = htmlToDataframe(table[0])
|
1347 |
df_demandeur = df_demandeur.sort_values(by=['Indicateur'])
|
1348 |
print(df_demandeur)
|
@@ -1377,20 +1363,20 @@ def load_from_stats(n_clicks, array_value, theme):
|
|
1377 |
|
1378 |
return dmc.Grid(children=children), dmc.Grid(children=children_tabs), False
|
1379 |
|
1380 |
-
|
1381 |
-
|
1382 |
-
|
1383 |
-
|
1384 |
-
|
1385 |
-
|
1386 |
-
|
1387 |
-
|
1388 |
-
|
1389 |
-
|
1390 |
|
1391 |
@callback(
|
1392 |
Output("clicked-output-skills", "children"),
|
1393 |
-
|
1394 |
Input("loading-skills", "n_clicks"),
|
1395 |
Input(component_id='framework-multi-select', component_property='value'),
|
1396 |
Input("mantine-provider", "forceColorScheme"),
|
@@ -1419,7 +1405,7 @@ def load_from_skills(n_clicks, array_value, theme):
|
|
1419 |
#children.append(dmc.GridCol(html.Div(dcc.Loading(id="loadingPlot",children=(dcc.Graph(figure=fig_Savoir)), type="default"), style=styleTitle), span=12),)
|
1420 |
#children.append(dmc.GridCol(html.Div(dcc.Loading(id="loadingPlot",children=(dcc.Graph(figure=fig_Context)), type="default"), style=styleTitle), span=12),)
|
1421 |
|
1422 |
-
return dmc.Grid(children=children)
|
1423 |
|
1424 |
|
1425 |
########### IA Chatbot ###########
|
|
|
1326 |
}
|
1327 |
children = []
|
1328 |
children_tabs = []
|
1329 |
+
for num_value in array_value:
|
1330 |
+
table = datavisualisation_chiffres_cles_emplois("https://dataemploi.pole-emploi.fr/metier/chiffres-cles/NAT/FR/" + num_value)
|
1331 |
+
array_label_rome = searchByRome(num_value)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1332 |
df_demandeur = htmlToDataframe(table[0])
|
1333 |
df_demandeur = df_demandeur.sort_values(by=['Indicateur'])
|
1334 |
print(df_demandeur)
|
|
|
1363 |
|
1364 |
return dmc.Grid(children=children), dmc.Grid(children=children_tabs), False
|
1365 |
|
1366 |
+
clientside_callback(
|
1367 |
+
"""
|
1368 |
+
function updateLoadingState(n_clicks) {
|
1369 |
+
return true
|
1370 |
+
}
|
1371 |
+
""",
|
1372 |
+
Output("loading-skills", "loading", allow_duplicate=True),
|
1373 |
+
Input("loading-skills", "n_clicks"),
|
1374 |
+
prevent_initial_call=True,
|
1375 |
+
)
|
1376 |
|
1377 |
@callback(
|
1378 |
Output("clicked-output-skills", "children"),
|
1379 |
+
Output("loading-skills", "loading"),
|
1380 |
Input("loading-skills", "n_clicks"),
|
1381 |
Input(component_id='framework-multi-select', component_property='value'),
|
1382 |
Input("mantine-provider", "forceColorScheme"),
|
|
|
1405 |
#children.append(dmc.GridCol(html.Div(dcc.Loading(id="loadingPlot",children=(dcc.Graph(figure=fig_Savoir)), type="default"), style=styleTitle), span=12),)
|
1406 |
#children.append(dmc.GridCol(html.Div(dcc.Loading(id="loadingPlot",children=(dcc.Graph(figure=fig_Context)), type="default"), style=styleTitle), span=12),)
|
1407 |
|
1408 |
+
return dmc.Grid(children=children), False
|
1409 |
|
1410 |
|
1411 |
########### IA Chatbot ###########
|