IO4IT 3.0.4__tar.gz → 3.0.4.1__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.
Files changed (96) hide show
  1. io4it-3.0.4.1/PKG-INFO +38 -0
  2. io4it-3.0.4.1/io4it.egg-info/PKG-INFO +38 -0
  3. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/utils/mail.py +31 -32
  4. {io4it-3.0.4 → io4it-3.0.4.1}/setup.py +1 -1
  5. io4it-3.0.4/PKG-INFO +0 -7
  6. io4it-3.0.4/io4it.egg-info/PKG-INFO +0 -7
  7. {io4it-3.0.4 → io4it-3.0.4.1}/io4it.egg-info/SOURCES.txt +0 -0
  8. {io4it-3.0.4 → io4it-3.0.4.1}/io4it.egg-info/dependency_links.txt +0 -0
  9. {io4it-3.0.4 → io4it-3.0.4.1}/io4it.egg-info/entry_points.txt +0 -0
  10. {io4it-3.0.4 → io4it-3.0.4.1}/io4it.egg-info/namespace_packages.txt +0 -0
  11. {io4it-3.0.4 → io4it-3.0.4.1}/io4it.egg-info/requires.txt +0 -0
  12. {io4it-3.0.4 → io4it-3.0.4.1}/io4it.egg-info/top_level.txt +0 -0
  13. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/__init__.py +0 -0
  14. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/ocr_function/__init__.py +0 -0
  15. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/ocr_function/word_converter.py +0 -0
  16. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/utils/__init__.py +0 -0
  17. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/utils/keys_manager.py +0 -0
  18. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/utils/pool_exec_utils.py +0 -0
  19. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/utils/secret_manager.py +0 -0
  20. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/utils/utils_md.py +0 -0
  21. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/OWChatGpt.py +0 -0
  22. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/OWDeep_Search.py +0 -0
  23. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/OWDoclingASR.py +0 -0
  24. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/OWDoclingToMarkdown.py +0 -0
  25. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/OWExportMarkdown.py +0 -0
  26. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/OWExtractTablesDocxToXlsx.py +0 -0
  27. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/OWInboxMailMonitoring.py +0 -0
  28. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/OWJsonToDataTable.py +0 -0
  29. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/OWMD2HTML.py +0 -0
  30. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/OWMarkdownLoader.py +0 -0
  31. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/OWMarkdownizer.py +0 -0
  32. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/OWOfficeNormalizer.py +0 -0
  33. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/OWParserHTML.py +0 -0
  34. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/OWPdfType.py +0 -0
  35. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/OWProcessPoolExecutor.py +0 -0
  36. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/OWS3Uploader.py +0 -0
  37. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/OWS3downloader.py +0 -0
  38. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/OWS3list.py +0 -0
  39. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/OWSpeechToText.py +0 -0
  40. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/OWWebSearch.py +0 -0
  41. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/OWmailLoader.py +0 -0
  42. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/OWmailSender.py +0 -0
  43. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/OWwordpdf2docx.py +0 -0
  44. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/__init__.py +0 -0
  45. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/designer/__init__.py +0 -0
  46. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/designer/nogui.ui +0 -0
  47. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/designer/ow_extract_tables_docx_to_xlsx.ui +0 -0
  48. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/designer/ow_file_ext_selector.ui +0 -0
  49. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/designer/ow_json_to_data_table.ui +0 -0
  50. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/designer/owchatgpt.ui +0 -0
  51. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/designer/owdeepsearch.ui +0 -0
  52. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/designer/owdoclingasr.ui +0 -0
  53. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/designer/owdoclingtomarkdown.ui +0 -0
  54. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/designer/owexportmarkdown.ui +0 -0
  55. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/designer/owinboxmailmonitoring.ui +0 -0
  56. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/designer/owmailloader.ui +0 -0
  57. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/designer/owmailsender.ui +0 -0
  58. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/designer/owmarkdownizer.ui +0 -0
  59. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/designer/owmarkdownloader.ui +0 -0
  60. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/designer/owmd2html.ui +0 -0
  61. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/designer/owofficenormalizer.ui +0 -0
  62. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/designer/owparserhtml.ui +0 -0
  63. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/designer/owpdftype.ui +0 -0
  64. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/designer/owprocesspoolexecutor.ui +0 -0
  65. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/designer/owspeechtotext.ui +0 -0
  66. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/designer/owvisualizationer.ui +0 -0
  67. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/designer/owwebsearch.ui +0 -0
  68. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/designer/wordpdf2docx.ui +0 -0
  69. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/icons/__init__.py +0 -0
  70. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/icons/chatgpt.png +0 -0
  71. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/icons/check_pdf.png +0 -0
  72. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/icons/deepsearch.svg +0 -0
  73. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/icons/dep_md_old.png +0 -0
  74. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/icons/download.png +0 -0
  75. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/icons/export_md.png +0 -0
  76. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/icons/extract_table.png +0 -0
  77. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/icons/file_extensor.png +0 -0
  78. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/icons/html.png +0 -0
  79. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/icons/json-file.png +0 -0
  80. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/icons/list_aws.png +0 -0
  81. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/icons/load_md.png +0 -0
  82. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/icons/mail_loader.png +0 -0
  83. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/icons/mail_writer.png +0 -0
  84. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/icons/md.png +0 -0
  85. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/icons/monitor-email.svg +0 -0
  86. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/icons/office_normalizer.png +0 -0
  87. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/icons/owmd2html.svg +0 -0
  88. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/icons/process_pool_executor.png +0 -0
  89. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/icons/speech_to_text.png +0 -0
  90. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/icons/upload.png +0 -0
  91. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/icons/visualizationer.png +0 -0
  92. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/icons/websearch.png +0 -0
  93. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/icons/wordpdf2docx.png +0 -0
  94. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/IO4IT/widgets/icons_dev/__init__.py +0 -0
  95. {io4it-3.0.4 → io4it-3.0.4.1}/orangecontrib/__init__.py +0 -0
  96. {io4it-3.0.4 → io4it-3.0.4.1}/setup.cfg +0 -0
io4it-3.0.4.1/PKG-INFO ADDED
@@ -0,0 +1,38 @@
1
+ Metadata-Version: 2.1
2
+ Name: io4it
3
+ Version: 3.0.4.1
4
+ Summary: UNKNOWN
5
+ Home-page:
6
+ Author:
7
+ Author-email:
8
+ License: UNKNOWN
9
+ Keywords: orange3 add-on
10
+ Platform: UNKNOWN
11
+ Requires-Dist: torchvision==0.23.0
12
+ Requires-Dist: torchaudio==2.8.0
13
+ Requires-Dist: torch==2.8.0
14
+ Requires-Dist: pylatexenc
15
+ Requires-Dist: docopt
16
+ Requires-Dist: boto3
17
+ Requires-Dist: opencv-python-headless==4.6.0.66
18
+ Requires-Dist: docling==2.30.0
19
+ Requires-Dist: docling-core==2.26.3
20
+ Requires-Dist: speechbrain
21
+ Requires-Dist: whisper
22
+ Requires-Dist: whisper-openai
23
+ Requires-Dist: pyannote.audio==3.4.0
24
+ Requires-Dist: pyannote-core
25
+ Requires-Dist: pypandoc
26
+ Requires-Dist: pypandoc-binary
27
+ Requires-Dist: scikit-learn
28
+ Requires-Dist: openai
29
+ Requires-Dist: pip-system-certs==5.0
30
+ Requires-Dist: docx2pdf
31
+ Requires-Dist: doc2docx
32
+ Requires-Dist: msal
33
+ Requires-Dist: exchangelib
34
+ Requires-Dist: html2text
35
+ Requires-Dist: ddgs
36
+ Requires-Dist: CATEGORIT
37
+
38
+ UNKNOWN
@@ -0,0 +1,38 @@
1
+ Metadata-Version: 2.1
2
+ Name: io4it
3
+ Version: 3.0.4.1
4
+ Summary: UNKNOWN
5
+ Home-page:
6
+ Author:
7
+ Author-email:
8
+ License: UNKNOWN
9
+ Keywords: orange3 add-on
10
+ Platform: UNKNOWN
11
+ Requires-Dist: torchvision==0.23.0
12
+ Requires-Dist: torchaudio==2.8.0
13
+ Requires-Dist: torch==2.8.0
14
+ Requires-Dist: pylatexenc
15
+ Requires-Dist: docopt
16
+ Requires-Dist: boto3
17
+ Requires-Dist: opencv-python-headless==4.6.0.66
18
+ Requires-Dist: docling==2.30.0
19
+ Requires-Dist: docling-core==2.26.3
20
+ Requires-Dist: speechbrain
21
+ Requires-Dist: whisper
22
+ Requires-Dist: whisper-openai
23
+ Requires-Dist: pyannote.audio==3.4.0
24
+ Requires-Dist: pyannote-core
25
+ Requires-Dist: pypandoc
26
+ Requires-Dist: pypandoc-binary
27
+ Requires-Dist: scikit-learn
28
+ Requires-Dist: openai
29
+ Requires-Dist: pip-system-certs==5.0
30
+ Requires-Dist: docx2pdf
31
+ Requires-Dist: doc2docx
32
+ Requires-Dist: msal
33
+ Requires-Dist: exchangelib
34
+ Requires-Dist: html2text
35
+ Requires-Dist: ddgs
36
+ Requires-Dist: CATEGORIT
37
+
38
+ UNKNOWN
@@ -809,18 +809,12 @@ def check_send_new_emails(offusc_conf_agent,type_co):
809
809
  print(f"❌ Erreur lors de l'envoi avec OAuth2 : {e}")
810
810
  elif type_co == "MICROSOFT_EXCHANGE_OAUTH2_MICROSOFT_GRAPH":
811
811
  try:
812
- client_id, client_secret, tenant_id, user_email = keys_manager.lire_config_oauth2(
813
- offusc_conf_agent)
812
+ client_id, client_secret, tenant_id, user_email = keys_manager.lire_config_oauth2(offusc_conf_agent)
814
813
 
815
- # Déduire l'alias pour le nom du dossier
816
814
  agent = user_email
817
- alias = user_email # tu peux adapter si tu veux un alias distinct plus tard
818
-
819
815
  chemin_dossier_in, chemin_dossier_out = mail_in_folder(agent, "out")
820
-
821
816
  authority = f"https://login.microsoftonline.com/{tenant_id}"
822
817
 
823
- # === Authentification avec MSAL ===
824
818
  app = ConfidentialClientApplication(
825
819
  client_id=client_id,
826
820
  client_credential=client_secret,
@@ -842,13 +836,34 @@ def check_send_new_emails(offusc_conf_agent,type_co):
842
836
  contenus = os.listdir(chemin_dossier_out)
843
837
  if contenus:
844
838
  for contenu in contenus:
845
- mail_ok_path = os.path.join(chemin_dossier_out, contenu, "mail.ok")
839
+ dossier_actuel = os.path.join(chemin_dossier_out, contenu)
840
+ mail_ok_path = os.path.join(dossier_actuel, "mail.ok")
841
+
846
842
  if os.path.exists(mail_ok_path):
847
- chemin = os.path.join(chemin_dossier_out, contenu, "mail.txt")
848
- infos = lire_message(chemin)
843
+ chemin_txt = os.path.join(dossier_actuel, "mail.txt")
844
+ infos = lire_message(chemin_txt)
849
845
 
850
846
  cles_requises = ["eme", "des", "cop", "pri", "tit", "txt"]
851
847
  if all(cle in infos for cle in cles_requises):
848
+
849
+ # --- GESTION DES PIÈCES JOINTES ---
850
+ attachments = []
851
+ chemin_pj = os.path.join(dossier_actuel, "pj")
852
+
853
+ if os.path.exists(chemin_pj) and os.path.isdir(chemin_pj):
854
+ for filename in os.listdir(chemin_pj):
855
+ file_path = os.path.join(chemin_pj, filename)
856
+ if os.path.isfile(file_path):
857
+ with open(file_path, "rb") as f:
858
+ content_bytes = f.read()
859
+ encoded_content = base64.b64encode(content_bytes).decode('utf-8')
860
+
861
+ attachments.append({
862
+ "@odata.type": "#microsoft.graph.fileAttachment",
863
+ "name": filename,
864
+ "contentBytes": encoded_content
865
+ })
866
+
852
867
  # Construire le message pour Microsoft Graph
853
868
  message_data = {
854
869
  "message": {
@@ -863,43 +878,27 @@ def check_send_new_emails(offusc_conf_agent,type_co):
863
878
  "address": infos["eme"]
864
879
  }
865
880
  }
866
- ]
881
+ ],
882
+ "attachments": attachments # Ajout de la liste des PJ
867
883
  },
868
884
  "saveToSentItems": True
869
885
  }
870
886
 
871
- # Envoyer l'email via Microsoft Graph
887
+ # Envoyer l'email
872
888
  send_url = f"https://graph.microsoft.com/v1.0/users/{user_email}/sendMail"
873
889
  try:
874
890
  response = requests.post(send_url, headers=headers, json=message_data)
875
891
  response.raise_for_status()
876
892
  except requests.exceptions.HTTPError as e:
877
893
  if response.status_code == 403:
878
- raise Exception(
879
- "❌ Permission Mail.Send manquante. Contactez votre IT Admin pour ajouter cette permission à l'application IA-ODATAMINING.")
894
+ raise Exception("❌ Permission Mail.Send manquante.")
880
895
  else:
881
896
  raise e
882
897
 
883
898
  time.sleep(1)
884
899
  MetManagement.reset_folder(os.path.join(chemin_dossier_in, contenu), recreate=False)
885
- MetManagement.reset_folder(os.path.join(chemin_dossier_out, contenu), recreate=False)
886
- else:
887
- print("\n\n Il manque des clefs dans le contenu du mail")
888
- print(
889
- f"📤 [DEBUG] Clés manquantes: {[cle for cle in cles_requises if cle not in infos]}")
890
- else:
891
- print(
892
- f"\n\n KO § os.path.exists(os.path.join(chemin_dossier_out, contenu): {os.path.exists(os.path.join(chemin_dossier_out, contenu, 'mail.ok'))}")
893
- else:
894
- print("Le dossier est vide.")
895
- else:
896
- print("Le dossier n'existe pas ou le chemin n'est pas un dossier.")
897
- print(f"📤 [DEBUG] Chemin vérifié: {chemin_dossier_out}")
898
- print(
899
- f"📤 [DEBUG] Existe: {os.path.exists(chemin_dossier_out)}, Est dossier: {os.path.isdir(chemin_dossier_out) if os.path.exists(chemin_dossier_out) else 'N/A'}")
900
-
901
- print("📤 [DEBUG] Vérification des emails à envoyer terminée")
902
-
900
+ MetManagement.reset_folder(os.path.join(chemin_dossier_out, contenu),
901
+ recreate=False)
903
902
  except Exception as e:
904
903
  print(f"❌ Erreur lors de l'envoi avec Graph API : {e}")
905
904
  print(f"📤 [DEBUG] Erreur détaillée: {type(e).__name__}: {str(e)}")
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  # Configuration
4
4
  NAME = "io4it"
5
- VERSION = "3.0.4"
5
+ VERSION = "3.0.4.1"
6
6
 
7
7
  INSTALL_REQUIRES = [
8
8
  "torchvision==0.23.0",
io4it-3.0.4/PKG-INFO DELETED
@@ -1,7 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: io4it
3
- Version: 3.0.4
4
- Home-page:
5
- Author:
6
- Author-email:
7
- Keywords: orange3 add-on
@@ -1,7 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: io4it
3
- Version: 3.0.4
4
- Home-page:
5
- Author:
6
- Author-email:
7
- Keywords: orange3 add-on
File without changes
File without changes