pyxtxt 0.2.1__tar.gz → 0.2.2__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 (33) hide show
  1. {pyxtxt-0.2.1/src/pyxtxt.egg-info → pyxtxt-0.2.2}/PKG-INFO +1 -1
  2. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/pyproject.toml +1 -1
  3. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/src/pyxtxt/estrattori/doc.py +11 -6
  4. {pyxtxt-0.2.1 → pyxtxt-0.2.2/src/pyxtxt.egg-info}/PKG-INFO +1 -1
  5. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/LICENCSE +0 -0
  6. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/MANIFEST.in +0 -0
  7. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/README.md +0 -0
  8. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/examples.py +0 -0
  9. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/setup.cfg +0 -0
  10. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/src/pyxtxt/__init__.py +0 -0
  11. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/src/pyxtxt/core.py +0 -0
  12. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/src/pyxtxt/estrattori/__init__.py +0 -0
  13. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/src/pyxtxt/estrattori/docx.py +0 -0
  14. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/src/pyxtxt/estrattori/eml.py +0 -0
  15. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/src/pyxtxt/estrattori/epub.py +0 -0
  16. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/src/pyxtxt/estrattori/html.py +0 -0
  17. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/src/pyxtxt/estrattori/md.py +0 -0
  18. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/src/pyxtxt/estrattori/msg.py +0 -0
  19. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/src/pyxtxt/estrattori/odt.py +0 -0
  20. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/src/pyxtxt/estrattori/pdf.py +0 -0
  21. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/src/pyxtxt/estrattori/pptx.py +0 -0
  22. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/src/pyxtxt/estrattori/rtf.py +0 -0
  23. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/src/pyxtxt/estrattori/svg.py +0 -0
  24. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/src/pyxtxt/estrattori/tex.py +0 -0
  25. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/src/pyxtxt/estrattori/txt.py +0 -0
  26. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/src/pyxtxt/estrattori/xls.py +0 -0
  27. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/src/pyxtxt/estrattori/xlsx.py +0 -0
  28. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/src/pyxtxt/estrattori/xml.py +0 -0
  29. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/src/pyxtxt/pyxtxt.py +0 -0
  30. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/src/pyxtxt.egg-info/SOURCES.txt +0 -0
  31. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/src/pyxtxt.egg-info/dependency_links.txt +0 -0
  32. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/src/pyxtxt.egg-info/requires.txt +0 -0
  33. {pyxtxt-0.2.1 → pyxtxt-0.2.2}/src/pyxtxt.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyxtxt
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: A Python library for extracting text from different types of files (PDF, DOCX, PPTX, XLSX, ODT, ecc.).
5
5
  Author-email: Giuseppe Levi <giuseppe.levi@gmail.com>
6
6
  License: MIT License
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "pyxtxt"
3
- version = "0.2.1"
3
+ version = "0.2.2"
4
4
  description = "A Python library for extracting text from different types of files (PDF, DOCX, PPTX, XLSX, ODT, ecc.)."
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.7"
@@ -10,15 +10,20 @@ def xtxt_doc(file_buffer):
10
10
  try:
11
11
  file_buffer.seek(0)
12
12
  data = file_buffer.read()
13
- with tempfile.NamedTemporaryFile(suffix=".doc") as temp_file:
13
+ with tempfile.NamedTemporaryFile(suffix=".doc", delete=False) as temp_file:
14
14
  temp_file.write(data)
15
15
  temp_file.flush()
16
16
  temp_path = temp_file.name
17
- result = subprocess.run(["antiword", temp_path],capture_output=True,text=True)
18
- if result.returncode != 0:
19
- print(f"⚠️ antiword failed: {result.stderr}")
20
- return None
21
- return result.stdout.strip()
17
+
18
+ try:
19
+ result = subprocess.run(["antiword", temp_path], capture_output=True, text=True)
20
+ if result.returncode != 0:
21
+ print(f"⚠️ antiword failed: {result.stderr}")
22
+ return None
23
+ return result.stdout.strip()
24
+ finally:
25
+ import os
26
+ os.unlink(temp_path)
22
27
  except Exception as e:
23
28
  print(f"⚠️ Error during extraction from DOC: {e}")
24
29
  return None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyxtxt
3
- Version: 0.2.1
3
+ Version: 0.2.2
4
4
  Summary: A Python library for extracting text from different types of files (PDF, DOCX, PPTX, XLSX, ODT, ecc.).
5
5
  Author-email: Giuseppe Levi <giuseppe.levi@gmail.com>
6
6
  License: MIT License
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes