iatoolkit 0.7.15__py3-none-any.whl → 0.8.0__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.
Potentially problematic release.
This version of iatoolkit might be problematic. Click here for more details.
- iatoolkit/common/routes.py +19 -4
- iatoolkit/iatoolkit.py +23 -0
- iatoolkit/services/excel_service.py +7 -1
- {iatoolkit-0.7.15.dist-info → iatoolkit-0.8.0.dist-info}/METADATA +1 -1
- {iatoolkit-0.7.15.dist-info → iatoolkit-0.8.0.dist-info}/RECORD +7 -26
- iatoolkit/static/temp/024f44a9-cc7e-4bde-9a3c-11903a8f5d3d.xlsx +0 -0
- iatoolkit/static/temp/0b97768e-79e8-43ec-b17e-ba3137f94e93.xlsx +0 -0
- iatoolkit/static/temp/202883ee-763e-4b40-9bb6-bfacfc5e65fe.xlsx +0 -0
- iatoolkit/static/temp/28287491-08b7-4863-a2a3-49fcb64a0906.xlsx +0 -0
- iatoolkit/static/temp/36780cac-7a46-4db4-ac98-7338a51aaf52.xlsx +0 -0
- iatoolkit/static/temp/5c1b66f6-d58f-4684-8a7a-df3bb1a35eaa.xlsx +0 -0
- iatoolkit/static/temp/5d5a3500-ec57-4e07-a554-8799a906d1ab.xlsx +0 -0
- iatoolkit/static/temp/65887e40-cf64-49aa-8d1f-651cb0f8cdf0.xlsx +0 -0
- iatoolkit/static/temp/6fa64b13-e8e5-40ad-8257-00fd1682dad8.xlsx +0 -0
- iatoolkit/static/temp/7ab7071f-ad9b-49e6-8e63-f08410625ce7.xlsx +0 -0
- iatoolkit/static/temp/824346d9-d54d-40c6-b5c2-9e1d84d0ae90.xlsx +0 -0
- iatoolkit/static/temp/9ca80c3d-d196-4dfc-8179-582584fae04c.xlsx +0 -0
- iatoolkit/static/temp/a34cb8a6-85fb-4ea8-aabe-889967cd83b5.xlsx +0 -0
- iatoolkit/static/temp/a7fc9c13-c509-4499-b4be-23bfa57cac31.xlsx +0 -0
- iatoolkit/static/temp/b83084f5-fe54-4580-885e-412b4388cbda.xlsx +0 -0
- iatoolkit/static/temp/c17c6864-34e1-448f-b0e9-380354256ea9.xlsx +0 -0
- iatoolkit/static/temp/customer_clusters.parquet +0 -0
- iatoolkit/static/temp/customer_clusters.xlsx +0 -0
- iatoolkit/static/temp/d1af98b8-18a9-4b94-b9bc-607d19a87d0d.xlsx +0 -0
- {iatoolkit-0.7.15.dist-info → iatoolkit-0.8.0.dist-info}/WHEEL +0 -0
- {iatoolkit-0.7.15.dist-info → iatoolkit-0.8.0.dist-info}/top_level.txt +0 -0
iatoolkit/common/routes.py
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
#
|
|
4
4
|
# IAToolkit is open source software.
|
|
5
5
|
|
|
6
|
-
from flask import render_template, redirect, flash, url_for,send_from_directory, current_app
|
|
6
|
+
from flask import render_template, redirect, flash, url_for,send_from_directory, current_app, abort
|
|
7
7
|
from iatoolkit.common.session_manager import SessionManager
|
|
8
8
|
from flask import jsonify
|
|
9
9
|
from iatoolkit.views.history_view import HistoryView
|
|
@@ -80,7 +80,22 @@ def register_views(injector, app):
|
|
|
80
80
|
|
|
81
81
|
@app.route('/download/<path:filename>')
|
|
82
82
|
def download_file(filename):
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
"""
|
|
84
|
+
Esta vista sirve un archivo previamente generado desde el directorio
|
|
85
|
+
configurado en IATOOLKIT_DOWNLOAD_DIR.
|
|
86
|
+
"""
|
|
87
|
+
# Valida que la configuración exista
|
|
88
|
+
if 'IATOOLKIT_DOWNLOAD_DIR' not in current_app.config:
|
|
89
|
+
abort(500, "Error de configuración: IATOOLKIT_DOWNLOAD_DIR no está definido.")
|
|
90
|
+
|
|
91
|
+
download_dir = current_app.config['IATOOLKIT_DOWNLOAD_DIR']
|
|
92
|
+
|
|
93
|
+
try:
|
|
94
|
+
return send_from_directory(
|
|
95
|
+
download_dir,
|
|
96
|
+
filename,
|
|
97
|
+
as_attachment=True # Fuerza la descarga en lugar de la visualización
|
|
98
|
+
)
|
|
99
|
+
except FileNotFoundError:
|
|
100
|
+
abort(404)
|
|
86
101
|
|
iatoolkit/iatoolkit.py
CHANGED
|
@@ -97,6 +97,9 @@ class IAToolkit:
|
|
|
97
97
|
self._setup_cli_commands()
|
|
98
98
|
self._setup_context_processors()
|
|
99
99
|
|
|
100
|
+
# Step 8: define the download_dir for excel's
|
|
101
|
+
self._setup_download_dir()
|
|
102
|
+
|
|
100
103
|
try:
|
|
101
104
|
self.version = _pkg_version("iatoolkit")
|
|
102
105
|
except PackageNotFoundError:
|
|
@@ -404,6 +407,26 @@ class IAToolkit:
|
|
|
404
407
|
)
|
|
405
408
|
return self.db_manager
|
|
406
409
|
|
|
410
|
+
def _setup_download_dir(self):
|
|
411
|
+
# 1. set the default download directory
|
|
412
|
+
default_download_dir = os.path.join(self.app.instance_path, 'downloads')
|
|
413
|
+
|
|
414
|
+
# 3. if user specified one, use it
|
|
415
|
+
download_dir = self.app.config.get('IATOOLKIT_DOWNLOAD_DIR', default_download_dir)
|
|
416
|
+
|
|
417
|
+
# 3. save it in the app config
|
|
418
|
+
self.app.config['IATOOLKIT_DOWNLOAD_DIR'] = download_dir
|
|
419
|
+
|
|
420
|
+
# 4. make sure the directory exists
|
|
421
|
+
try:
|
|
422
|
+
os.makedirs(download_dir, exist_ok=True)
|
|
423
|
+
except OSError as e:
|
|
424
|
+
raise IAToolkitException(
|
|
425
|
+
IAToolkitException.ErrorType.CONFIG_ERROR,
|
|
426
|
+
"No se pudo crear el directorio de descarga. Verifique que el directorio existe y tenga permisos de escritura."
|
|
427
|
+
)
|
|
428
|
+
logging.info(f"✅ download dir created in: {download_dir}")
|
|
429
|
+
|
|
407
430
|
|
|
408
431
|
def current_iatoolkit() -> IAToolkit:
|
|
409
432
|
return IAToolkit.get_instance()
|
|
@@ -55,7 +55,13 @@ class ExcelService:
|
|
|
55
55
|
|
|
56
56
|
# 3. create temporary name
|
|
57
57
|
token = f"{uuid4()}.xlsx"
|
|
58
|
-
|
|
58
|
+
|
|
59
|
+
# 4. check that download directory is configured
|
|
60
|
+
if 'IATOOLKIT_DOWNLOAD_DIR' not in current_app.config:
|
|
61
|
+
return 'no esta configurado el directorio temporal para guardar excels'
|
|
62
|
+
|
|
63
|
+
download_dir = current_app.config['IATOOLKIT_DOWNLOAD_DIR']
|
|
64
|
+
filepath = Path(download_dir) / token
|
|
59
65
|
filepath.parent.mkdir(parents=True, exist_ok=True)
|
|
60
66
|
|
|
61
67
|
# 4. save excel file in temporary directory
|
|
@@ -2,11 +2,11 @@ iatoolkit/__init__.py,sha256=yi7Uw68KajDWUUo-v4xV31Nt7hjr_-2gCXbkhdiDl44,1887
|
|
|
2
2
|
iatoolkit/base_company.py,sha256=gM3X7xedNaVLodOObvjUN9eJKPO5-HmSLaBFa9jowCk,4277
|
|
3
3
|
iatoolkit/cli_commands.py,sha256=G5L9xQXZ0lVFXQWBaE_KEZHyfuiT6PL1nTQRoSdnBzc,2302
|
|
4
4
|
iatoolkit/company_registry.py,sha256=tduqt3oV8iDX_IB1eA7KIgvIxE4edTcy-3qZIXh3Lzw,2549
|
|
5
|
-
iatoolkit/iatoolkit.py,sha256=
|
|
5
|
+
iatoolkit/iatoolkit.py,sha256=S6PQ_rty7wD6XwXXAUmaWc2e2D2Sqj3epqnP4KK3nYE,16831
|
|
6
6
|
iatoolkit/common/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
iatoolkit/common/auth.py,sha256=8NH6MQXfddLQd1GxrO2op3IYrrP4SMQKoKzj1o1jZmc,8486
|
|
8
8
|
iatoolkit/common/exceptions.py,sha256=EXx40n5htp7UiOM6P1xfJ9U6NMcADqm62dlFaKz7ICU,1154
|
|
9
|
-
iatoolkit/common/routes.py,sha256=
|
|
9
|
+
iatoolkit/common/routes.py,sha256=8_wvrFiB5w5Sq-5gZfIDz9JVPROd9JED5oxkX1N87gY,4923
|
|
10
10
|
iatoolkit/common/session_manager.py,sha256=7D_RuJs60w-1zDr3fOGEz9JW7IZlSXuUHgUT87CzaUo,472
|
|
11
11
|
iatoolkit/common/util.py,sha256=08js3KLJTXICOd5sgwDp2u_kDaZO_0xG4BIuzWZnLo8,15535
|
|
12
12
|
iatoolkit/infra/__init__.py,sha256=5JqK9sZ6jBuK83zDQokUhxQ0wuJJJ9DXB8pYCLkX7X4,102
|
|
@@ -38,7 +38,7 @@ iatoolkit/services/__init__.py,sha256=5JqK9sZ6jBuK83zDQokUhxQ0wuJJJ9DXB8pYCLkX7X
|
|
|
38
38
|
iatoolkit/services/benchmark_service.py,sha256=CdbFYyS3FHFhNzWQEa9ZNjUlmON10DT1nKNbZQ1EUi8,5880
|
|
39
39
|
iatoolkit/services/dispatcher_service.py,sha256=ykR1ye6McyCCuaBgwH6r3-PqcLAr4v4ApkPazMSBzbs,14040
|
|
40
40
|
iatoolkit/services/document_service.py,sha256=nMXrNtbHQuc9pSaten0LvKY0kT8_WngBDmZJUP3jNPw,5936
|
|
41
|
-
iatoolkit/services/excel_service.py,sha256=
|
|
41
|
+
iatoolkit/services/excel_service.py,sha256=CJGhu7cQl9J6y_ZWSJ-M63Xm-RXR9Zs66oOR2NJErZQ,3868
|
|
42
42
|
iatoolkit/services/file_processor_service.py,sha256=B1sUUhZNFf-rT4_1wrD38GKNoBFMp2g0dYrXYMCWe2E,4122
|
|
43
43
|
iatoolkit/services/history_service.py,sha256=JwW958tYTrcdWSP5TRoDgDtBdGCvWIG4fnmHsrXLQ-8,1617
|
|
44
44
|
iatoolkit/services/jwt_service.py,sha256=YoZ9h7_o9xBko-arNQv4MbcwnxoSWVNj4VbZmMo_QGY,3908
|
|
@@ -69,25 +69,6 @@ iatoolkit/static/styles/chat_iatoolkit.css,sha256=ZPQAgLT0HIeXjZC_EY8xACmVdjEp7s
|
|
|
69
69
|
iatoolkit/static/styles/chat_info.css,sha256=17DbgoNYE21VYWfb5L9-QLCpD2R1idK4imKRLwXtJLY,1058
|
|
70
70
|
iatoolkit/static/styles/chat_modal.css,sha256=67qwltu-QS-sU0d_fSeTIiXwcNjfAnQQtmsgStx-ezk,3047
|
|
71
71
|
iatoolkit/static/styles/llm_output.css,sha256=AlxgRSOleeCk2dLAqFWVaQ-jwZiJjcpC5rHuUv3T6VU,2312
|
|
72
|
-
iatoolkit/static/temp/024f44a9-cc7e-4bde-9a3c-11903a8f5d3d.xlsx,sha256=_6n2A4apLWkQvORpQOAAKGYlQyCHlCUDPJDzJ4Ons14,8788
|
|
73
|
-
iatoolkit/static/temp/0b97768e-79e8-43ec-b17e-ba3137f94e93.xlsx,sha256=hxkJNPzqfSRcYUO6sxD1X8O8o0ULO0lBCj0ifsDfwBU,6937
|
|
74
|
-
iatoolkit/static/temp/202883ee-763e-4b40-9bb6-bfacfc5e65fe.xlsx,sha256=reGomquStUq8iH3rByXJSPH4DH7MpdGxqy3puQ3jYHM,6103
|
|
75
|
-
iatoolkit/static/temp/28287491-08b7-4863-a2a3-49fcb64a0906.xlsx,sha256=7rQMpkXfXlFdyAhTWM3m_7EO-FCVNXLk1Hexd97mspk,9517
|
|
76
|
-
iatoolkit/static/temp/36780cac-7a46-4db4-ac98-7338a51aaf52.xlsx,sha256=DUKW7DUaMAgFbKHm3vYK6GezRMq58fHBJCNMokyuQ9k,5426
|
|
77
|
-
iatoolkit/static/temp/5c1b66f6-d58f-4684-8a7a-df3bb1a35eaa.xlsx,sha256=c8157lfVgtcbw94fqS1GkW2eO3VZ9MVtkWouC4jC_Lo,7605
|
|
78
|
-
iatoolkit/static/temp/5d5a3500-ec57-4e07-a554-8799a906d1ab.xlsx,sha256=8dnb4nba-5g2aRYXSBwVSJ5EV4Ah-4dCV7cqSxhJVgk,5794
|
|
79
|
-
iatoolkit/static/temp/65887e40-cf64-49aa-8d1f-651cb0f8cdf0.xlsx,sha256=_AGAhHHQo9pCXOgvDZ83K25dOrelfuxwjTJW85QcWGM,9055
|
|
80
|
-
iatoolkit/static/temp/6fa64b13-e8e5-40ad-8257-00fd1682dad8.xlsx,sha256=FYOJNCZOwXFK_2Ork7vL4pGqZyJR5hLv09RrH_tosJk,7339
|
|
81
|
-
iatoolkit/static/temp/7ab7071f-ad9b-49e6-8e63-f08410625ce7.xlsx,sha256=JWbGzhnwErg4V5jrCXGUZafxduCKcPHagM8TTsAMJro,5806
|
|
82
|
-
iatoolkit/static/temp/824346d9-d54d-40c6-b5c2-9e1d84d0ae90.xlsx,sha256=czRFxIL1opDDaqnDePF8aqIu7tQDmDB8hvyuZRes09w,5843
|
|
83
|
-
iatoolkit/static/temp/9ca80c3d-d196-4dfc-8179-582584fae04c.xlsx,sha256=DUQWwcMkq3UkUCr3TxqJuHx3ODwS5jxYCrgHnBaxcCI,6525
|
|
84
|
-
iatoolkit/static/temp/a34cb8a6-85fb-4ea8-aabe-889967cd83b5.xlsx,sha256=3O6b2c29sYOZ1vfW9eHnNl-7bpyxcyX9h2MC6Xlq0JA,8968
|
|
85
|
-
iatoolkit/static/temp/a7fc9c13-c509-4499-b4be-23bfa57cac31.xlsx,sha256=EIO1XPlO-TBQq5gd8pJ3t2SiEwDkFynkkALSXP4yMog,5379
|
|
86
|
-
iatoolkit/static/temp/b83084f5-fe54-4580-885e-412b4388cbda.xlsx,sha256=mQc6ZBWOLLUMhPJmsfqlb0heAVCrwjkt65mqkVg3Y7c,9041
|
|
87
|
-
iatoolkit/static/temp/c17c6864-34e1-448f-b0e9-380354256ea9.xlsx,sha256=WDvGGyxAhl96CeV-1Co9OGCOBmMIOD1UODHzj-wA0a0,5266
|
|
88
|
-
iatoolkit/static/temp/customer_clusters.parquet,sha256=vlzC453Aqu-QXOzCksgeyKleuHFctr-fEcVy4ejJJak,15177
|
|
89
|
-
iatoolkit/static/temp/customer_clusters.xlsx,sha256=7lN6Q0_GDj8VI5_-oMPbFHT9DxBRiK64PVH6js3PWNI,9920
|
|
90
|
-
iatoolkit/static/temp/d1af98b8-18a9-4b94-b9bc-607d19a87d0d.xlsx,sha256=lY4DGo1L-bLcK3j5wioLC0SwDLSw0SjyKUmISaKuSdU,5787
|
|
91
72
|
iatoolkit/system_prompts/format_styles.prompt,sha256=MSMe1qvR3cF_0IbFshn8R0z6Wx6VCHQq1p37rpu5wwk,3576
|
|
92
73
|
iatoolkit/system_prompts/query_main.prompt,sha256=w_9ybgWgiQH4V_RbAXqsvz0M7oOuiyhxcwf-D0CgfA4,3017
|
|
93
74
|
iatoolkit/system_prompts/sql_rules.prompt,sha256=y4nURVnb9AyFwt-lrbMNBHHtZlhk6kC9grYoOhRnrJo,59174
|
|
@@ -188,7 +169,7 @@ tests/views/test_tasks_review_view.py,sha256=HXbAY99rbcdg-ZoaU3kxp-jNTPgOhgiTyKm
|
|
|
188
169
|
tests/views/test_tasks_view.py,sha256=TNdV69Vt17uc-vBI37A7qtRNqyPho2MoW7cgGxQKecU,4551
|
|
189
170
|
tests/views/test_user_feedback_view.py,sha256=IfKOpsncmf5ciMDsGuPtro9GdKXkxhRzsysVlEEM_HA,9181
|
|
190
171
|
tests/views/test_verify_user_view.py,sha256=dxQ3ibOETEuP8M50Gmwbmzj2L6UU7PAyC91Wp9Xs0K0,4772
|
|
191
|
-
iatoolkit-0.
|
|
192
|
-
iatoolkit-0.
|
|
193
|
-
iatoolkit-0.
|
|
194
|
-
iatoolkit-0.
|
|
172
|
+
iatoolkit-0.8.0.dist-info/METADATA,sha256=vlvBB4vIGEe3KZeM1Z0H4eNNExJ_MGsF-u76hXSJRoY,9300
|
|
173
|
+
iatoolkit-0.8.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
174
|
+
iatoolkit-0.8.0.dist-info/top_level.txt,sha256=or0Ar3Su6BhTy86zRrUwMAWtsR8Nk-tFEwdC0CZpKCs,16
|
|
175
|
+
iatoolkit-0.8.0.dist-info/RECORD,,
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|