pysfi 0.1.12__py3-none-any.whl → 0.1.14__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.
Files changed (42) hide show
  1. {pysfi-0.1.12.dist-info → pysfi-0.1.14.dist-info}/METADATA +1 -1
  2. pysfi-0.1.14.dist-info/RECORD +68 -0
  3. {pysfi-0.1.12.dist-info → pysfi-0.1.14.dist-info}/entry_points.txt +3 -0
  4. sfi/__init__.py +19 -2
  5. sfi/alarmclock/__init__.py +3 -0
  6. sfi/alarmclock/alarmclock.py +23 -40
  7. sfi/bumpversion/__init__.py +3 -1
  8. sfi/bumpversion/bumpversion.py +64 -15
  9. sfi/cleanbuild/__init__.py +3 -0
  10. sfi/cleanbuild/cleanbuild.py +5 -1
  11. sfi/cli.py +25 -4
  12. sfi/condasetup/__init__.py +1 -0
  13. sfi/condasetup/condasetup.py +91 -76
  14. sfi/docdiff/__init__.py +1 -0
  15. sfi/docdiff/docdiff.py +3 -2
  16. sfi/docscan/__init__.py +1 -1
  17. sfi/docscan/docscan.py +78 -23
  18. sfi/docscan/docscan_gui.py +152 -48
  19. sfi/filedate/filedate.py +12 -5
  20. sfi/img2pdf/img2pdf.py +453 -0
  21. sfi/llmclient/llmclient.py +31 -8
  22. sfi/llmquantize/llmquantize.py +76 -37
  23. sfi/llmserver/__init__.py +1 -0
  24. sfi/llmserver/llmserver.py +63 -13
  25. sfi/makepython/makepython.py +1145 -201
  26. sfi/pdfsplit/pdfsplit.py +45 -12
  27. sfi/pyarchive/__init__.py +1 -0
  28. sfi/pyarchive/pyarchive.py +908 -278
  29. sfi/pyembedinstall/pyembedinstall.py +88 -89
  30. sfi/pylibpack/pylibpack.py +561 -463
  31. sfi/pyloadergen/pyloadergen.py +372 -218
  32. sfi/pypack/pypack.py +510 -959
  33. sfi/pyprojectparse/pyprojectparse.py +337 -40
  34. sfi/pysourcepack/__init__.py +1 -0
  35. sfi/pysourcepack/pysourcepack.py +210 -131
  36. sfi/quizbase/quizbase_gui.py +2 -2
  37. sfi/taskkill/taskkill.py +168 -59
  38. sfi/which/which.py +11 -3
  39. pysfi-0.1.12.dist-info/RECORD +0 -62
  40. sfi/workflowengine/workflowengine.py +0 -444
  41. {pysfi-0.1.12.dist-info → pysfi-0.1.14.dist-info}/WHEEL +0 -0
  42. /sfi/{workflowengine → img2pdf}/__init__.py +0 -0
sfi/pdfsplit/pdfsplit.py CHANGED
@@ -7,7 +7,6 @@ from pathlib import Path
7
7
  import fitz
8
8
 
9
9
  logging.basicConfig(level=logging.INFO, format="%(message)s")
10
- cwd = Path.cwd()
11
10
  logger = logging.getLogger(__name__)
12
11
 
13
12
 
@@ -50,7 +49,9 @@ def split_by_number(input_file: Path, output_file: Path, number: int) -> None:
50
49
 
51
50
  end_page = min(current_page + pages_in_this_part, total_pages)
52
51
 
53
- part_file = output_file.parent / f"{output_file.stem}_part{i + 1}{output_file.suffix}"
52
+ part_file = (
53
+ output_file.parent / f"{output_file.stem}_part{i + 1}{output_file.suffix}"
54
+ )
54
55
  part_doc = fitz.open()
55
56
 
56
57
  for page_num in range(current_page, end_page):
@@ -58,7 +59,9 @@ def split_by_number(input_file: Path, output_file: Path, number: int) -> None:
58
59
 
59
60
  part_doc.save(part_file)
60
61
  part_doc.close()
61
- logger.info(f"Created part {i + 1}: {part_file} (pages {current_page + 1}-{end_page})")
62
+ logger.info(
63
+ f"Created part {i + 1}: {part_file} (pages {current_page + 1}-{end_page})"
64
+ )
62
65
 
63
66
  current_page = end_page
64
67
 
@@ -77,7 +80,10 @@ def split_by_size(input_file: Path, output_file: Path, size: int) -> None:
77
80
 
78
81
  while start_page < total_pages:
79
82
  end_page = min(start_page + size, total_pages)
80
- part_file = output_file.parent / f"{output_file.stem}_part{part + 1}{output_file.suffix}"
83
+ part_file = (
84
+ output_file.parent
85
+ / f"{output_file.stem}_part{part + 1}{output_file.suffix}"
86
+ )
81
87
  part_doc = fitz.open()
82
88
 
83
89
  for page_num in range(start_page, end_page):
@@ -85,7 +91,9 @@ def split_by_size(input_file: Path, output_file: Path, size: int) -> None:
85
91
 
86
92
  part_doc.save(part_file)
87
93
  part_doc.close()
88
- logger.info(f"Created part {part + 1}: {part_file} (pages {start_page + 1}-{end_page})")
94
+ logger.info(
95
+ f"Created part {part + 1}: {part_file} (pages {start_page + 1}-{end_page})"
96
+ )
89
97
 
90
98
  start_page = end_page
91
99
  part += 1
@@ -122,18 +130,37 @@ def split_by_range(input_file: Path, output_file: Path, range_str: str) -> None:
122
130
 
123
131
 
124
132
  def main() -> None:
133
+ """Main entry point for pdfsplit CLI."""
125
134
  parser = argparse.ArgumentParser(description="Split PDF files")
126
135
  parser.add_argument("input", help="Input PDF file")
127
- parser.add_argument("output", nargs="?", help="Output PDF file (optional for -n and -s modes)")
128
- parser.add_argument("-o", "--output-dir", default=str(cwd), help="Output directory (default: current directory)")
129
- parser.add_argument("-f", "--output-format", help="Output file format pattern, e.g., 'split_{part:02d}.pdf'")
136
+ parser.add_argument(
137
+ "output", nargs="?", help="Output PDF file (optional for -n and -s modes)"
138
+ )
139
+ parser.add_argument(
140
+ "-o",
141
+ "--output-dir",
142
+ default=".",
143
+ help="Output directory (default: current directory)",
144
+ )
145
+ parser.add_argument(
146
+ "-f",
147
+ "--output-format",
148
+ help="Output file format pattern, e.g., 'split_{part:02d}.pdf'",
149
+ )
130
150
  parser.add_argument("-v", "--verbose", action="store_true", help="Verbose output")
131
151
 
132
152
  # Split by number, size, or range
133
153
  group = parser.add_mutually_exclusive_group(required=True)
134
154
  group.add_argument("-n", "--number", type=int, help="Number of splits")
135
- group.add_argument("-s", "--size", type=int, default=1, help="Size of each split in pages")
136
- group.add_argument("-r", "--range", type=str, help="Range of pages to extract, e.g., '1,2,4-10,15-20,25-'")
155
+ group.add_argument(
156
+ "-s", "--size", type=int, default=1, help="Size of each split in pages"
157
+ )
158
+ group.add_argument(
159
+ "-r",
160
+ "--range",
161
+ type=str,
162
+ help="Range of pages to extract, e.g., '1,2,4-10,15-20,25-'",
163
+ )
137
164
 
138
165
  args = parser.parse_args()
139
166
 
@@ -142,7 +169,9 @@ def main() -> None:
142
169
 
143
170
  output_dir = Path(args.output_dir)
144
171
  if not output_dir.is_dir():
145
- logger.error(f"Output directory {args.output_dir} does not exist, please check the path.")
172
+ logger.error(
173
+ f"Output directory {args.output_dir} does not exist, please check the path."
174
+ )
146
175
  return
147
176
 
148
177
  input_file = Path(args.input)
@@ -157,7 +186,11 @@ def main() -> None:
157
186
  return
158
187
 
159
188
  if not args.range:
160
- output_file = output_dir / (input_file.stem + "_split.pdf") if not args.output else Path(args.output)
189
+ output_file = (
190
+ output_dir / (input_file.stem + "_split.pdf")
191
+ if not args.output
192
+ else Path(args.output)
193
+ )
161
194
  else:
162
195
  output_file = Path(args.output)
163
196
 
@@ -0,0 +1 @@
1
+