pyeasyphd 0.2.2__tar.gz → 0.2.4__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.

Potentially problematic release.


This version of pyeasyphd might be problematic. Click here for more details.

Files changed (43) hide show
  1. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/PKG-INFO +4 -4
  2. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/pyeasyphd.sublime-settings +20 -7
  3. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/tools/generate/generate_links.py +22 -3
  4. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/tools/py_run_bib_md_tex.py +88 -40
  5. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyproject.toml +4 -4
  6. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/README.md +0 -0
  7. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/.python-version +0 -0
  8. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/Main.sublime-menu +0 -0
  9. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/__init__.py +0 -0
  10. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/data/Templates/CSL/apa-no-ampersand.csl +0 -0
  11. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/data/Templates/CSL/apa.csl +0 -0
  12. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/data/Templates/CSL/ieee.csl +0 -0
  13. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/data/Templates/TEX/Article.tex +0 -0
  14. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/data/Templates/TEX/Article_Header.tex +0 -0
  15. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/data/Templates/TEX/Article_Tail.tex +0 -0
  16. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/data/Templates/TEX/Beamer_Header.tex +0 -0
  17. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/data/Templates/TEX/Beamer_Tail.tex +0 -0
  18. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/data/Templates/TEX/Style.tex +0 -0
  19. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/data/Templates/TEX/TEVC_Header.tex +0 -0
  20. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/data/Templates/TEX/TEVC_Tail.tex +0 -0
  21. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/data/Templates/TEX/eisvogel.beamer +0 -0
  22. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/data/Templates/TEX/eisvogel.latex +0 -0
  23. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/data/Templates/TEX/eisvogel.tex +0 -0
  24. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/data/Templates/TEX/math.tex +0 -0
  25. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/data/Templates/TEX/math_commands.tex +0 -0
  26. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/main/__init__.py +0 -0
  27. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/main/basic_input.py +0 -0
  28. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/main/pandoc_md_to.py +0 -0
  29. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/main/python_run_md.py +0 -0
  30. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/main/python_run_tex.py +0 -0
  31. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/pyeasyphd.py +0 -0
  32. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/pyeasyphd.sublime-syntax +0 -0
  33. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/tools/__init__.py +0 -0
  34. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/tools/generate/generate_from_bibs.py +0 -0
  35. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/tools/generate/generate_html.py +0 -0
  36. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/tools/generate/generate_library.py +0 -0
  37. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/tools/search/data.py +0 -0
  38. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/tools/search/search_base.py +0 -0
  39. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/tools/search/search_core.py +0 -0
  40. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/tools/search/search_keywords.py +0 -0
  41. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/tools/search/search_writers.py +0 -0
  42. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/tools/search/utils.py +0 -0
  43. {pyeasyphd-0.2.2 → pyeasyphd-0.2.4}/pyeasyphd/utils/utils.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyeasyphd
3
- Version: 0.2.2
3
+ Version: 0.2.4
4
4
  Summary: pyeasyphd
5
5
  License: GPL-3.0-or-later
6
6
  Keywords: Python,Markdown,LaTex
@@ -17,9 +17,9 @@ Classifier: Programming Language :: Python :: 3.14
17
17
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
18
  Requires-Dist: pyadvtools (>=0.2.0,<0.3.0)
19
19
  Requires-Dist: pybibtexer (>=0.2.0,<0.3.0)
20
- Project-URL: Documentation, https://github.com/NextArtifIntell/pyeasyphd
21
- Project-URL: Homepage, https://github.com/NextArtifIntell/pyeasyphd
22
- Project-URL: Repository, https://github.com/NextArtifIntell/pyeasyphd
20
+ Project-URL: Documentation, https://github.com/Easy-PhD/pyeasyphd
21
+ Project-URL: Homepage, https://github.com/Easy-PhD/pyeasyphd
22
+ Project-URL: Repository, https://github.com/Easy-PhD/pyeasyphd
23
23
  Description-Content-Type: text/markdown
24
24
 
25
25
  # pyeasyphd
@@ -50,20 +50,33 @@
50
50
  "bib_path_or_file": "",
51
51
 
52
52
  // Path to the figures directory (must be a directory path, not a file)
53
- "figures_directory": "",
53
+ "includegraphics_figs_directory": "",
54
54
  // ture, false
55
- "shutil_figures": true,
55
+ "shutil_includegraphics_figs": true,
56
+ // ture, false
57
+ "includegraphics_figs_in_relative_path": true,
58
+ // figure postfixes
59
+ "includegraphics_figs_postfixes": ["eps", "jpg", "png", "svg", "psd", "raw", "jpeg", "pdf"],
60
+
61
+ // Path to the texes directory (must be a directory path, not a file)
62
+ "input_texs_directory": "",
63
+ // true, false
64
+ "shutil_input_texs": true,
65
+ // ture, false
66
+ "input_texs_in_relative_path": true,
67
+ // tex postfixes
68
+ "input_texs_postfixes": ["tex", "latex"],
56
69
 
57
70
  // true, false
58
71
  "generate_html": false,
59
72
  // true, false
60
73
  "generate_tex": true,
61
74
 
62
- // for figure, bib, tex, and md
63
- "figure_folder_name": "fig", // "" or "figs" or "main"
64
- "bib_folder_name": "bib", // "" or "bibs" or "main"
65
- "md_folder_name": "md", // "" or "mds" or "main"
66
- "tex_folder_name": "tex", // "" or "texs" or "main"
75
+ // for fig, bib, tex, and md
76
+ "fig_folder_name": "fig", // "" or "fig" or "figs" or "main"
77
+ "bib_folder_name": "bib", // "" or "bib" or "bibs" or "main"
78
+ "md_folder_name": "md", // "" or "md" or "mds" or "main"
79
+ "tex_folder_name": "tex", // "" or "tex" or "texs" or "main"
67
80
 
68
81
  // for delete original md, tex, and bib files in output folder
69
82
  "delete_original_md_in_output_folder": false,
@@ -62,6 +62,19 @@ class PaperLinksGenerator(object):
62
62
 
63
63
  self._generate_links(cj, flags, folder_flags, folder_name)
64
64
 
65
+ def generate_monthly_links(self, folder_name=os.path.join("data", "Monthly")) -> None:
66
+ """Generate monthly markdown table with journal paper links.
67
+
68
+ Args:
69
+ folder_name (str, optional): Output folder name. Defaults to "data/Weekly".
70
+ """
71
+ cj = "Journals"
72
+
73
+ flags = ["All Months"]
74
+ folder_flags = [f"current_year_{f.replace(' ', '_').lower()}" for f in flags]
75
+
76
+ self._generate_links(cj, flags, folder_flags, folder_name)
77
+
65
78
  def generate_weekly_links(self, folder_name=os.path.join("data", "Weekly")) -> None:
66
79
  """Generate weekly markdown table with journal paper links.
67
80
 
@@ -70,7 +83,7 @@ class PaperLinksGenerator(object):
70
83
  """
71
84
  cj = "Journals"
72
85
 
73
- flags = ["Current Issue", "Current Month", "All Months"]
86
+ flags = ["Current Issue", "Current Month"]
74
87
  folder_flags = [f"current_year_{f.replace(' ', '_').lower()}" for f in flags]
75
88
 
76
89
  self._generate_links(cj, flags, folder_flags, folder_name)
@@ -269,8 +282,14 @@ class PaperLinksGenerator(object):
269
282
 
270
283
  return None
271
284
 
272
- def generate_keywords_links_monthly(self, cj: str, folder_name=os.path.join("data", "Weekly")):
273
- flags = ["Current Issue", "Current Month", "All Months"]
285
+ def generate_keywords_links_weekly(self, cj: str, folder_name=os.path.join("data", "Weekly")):
286
+ flags = ["Current Issue", "Current Month"]
287
+ folder_flags = [f"current_year_{f.replace(' ', '_').lower()}" for f in flags]
288
+
289
+ self._generate_keywords_links(cj, folder_name, flags, folder_flags)
290
+
291
+ def generate_keywords_links_monthly(self, cj: str, folder_name=os.path.join("data", "Monthly")):
292
+ flags = ["All Months"]
274
293
  folder_flags = [f"current_year_{f.replace(' ', '_').lower()}" for f in flags]
275
294
 
276
295
  self._generate_keywords_links(cj, folder_name, flags, folder_flags)
@@ -1,7 +1,7 @@
1
1
  import os
2
2
  import re
3
3
  import shutil
4
- from typing import Any, Dict, List, Optional, Tuple, Union
4
+ from typing import Any, Dict, List, Tuple, Union
5
5
 
6
6
  from pyadvtools import combine_content_in_list, read_list, standard_path, write_list
7
7
  from pybibtexer.bib.bibtexparser import Library
@@ -18,11 +18,7 @@ class PyRunBibMdTex(BasicInput):
18
18
  """
19
19
 
20
20
  def __init__(
21
- self,
22
- path_output: str,
23
- tex_md_flag: str = ".md",
24
- template_name: str = "paper",
25
- options: Dict[str, Any] = {}
21
+ self, path_output: str, tex_md_flag: str = ".md", template_name: str = "paper", options: Dict[str, Any] = {}
26
22
  ) -> None:
27
23
  """Initialize the PyRunBibMdTex instance.
28
24
 
@@ -47,17 +43,31 @@ class PyRunBibMdTex(BasicInput):
47
43
  # Path to bibliographic data, can be either a directory path or a specific file path
48
44
  self.bib_path_or_file = options.get("bib_path_or_file", "")
49
45
 
50
- # Figures
46
+ # Figures \includegraphics{/path/to/example.png}
51
47
  # Path to the figures directory (must be a directory path, not a file)
52
- self.figures_directory = options.get("figures_directory", "")
53
- self.shutil_figures = options.get("shutil_figures", True)
48
+ self.includegraphics_figs_directory = options.get("includegraphics_figs_directory", "")
49
+ self.shutil_includegraphics_figs = options.get("shutil_includegraphics_figs", True)
50
+ self.includegraphics_figs_in_relative_path = options.get("includegraphics_figs_in_relative_path", True)
51
+ includegraphics_figs_postfixes = options.get("includegraphics_figs_postfixes")
52
+ if includegraphics_figs_postfixes is None:
53
+ includegraphics_figs_postfixes = ["eps", "jpg", "png", "svg", "psd", "raw", "jpeg", "pdf"]
54
+ self.includegraphics_figs_postfixes = includegraphics_figs_postfixes
55
+
56
+ # Texs (Texes) \input{/path/to/example.tex}
57
+ self.input_texs_directory = options.get("input_texs_directory", "")
58
+ self.shutil_input_texs = options.get("shutil_input_texs", True)
59
+ self.input_texs_in_relative_path = options.get("input_texs_in_relative_path", True)
60
+ input_texs_postfixes = options.get("input_texs_postfixes")
61
+ if input_texs_postfixes is None:
62
+ input_texs_postfixes = ["tex", "latex"]
63
+ self.input_texs_postfixes = input_texs_postfixes
54
64
 
55
65
  # Configuration options
56
66
  self.generate_html = options.get("generate_html", False)
57
67
  self.generate_tex = options.get("generate_tex", True)
58
68
 
59
69
  # Folder name configurations
60
- self.figure_folder_name = options.get("figure_folder_name", "fig") # "" or "figs" or "main"
70
+ self.fig_folder_name = options.get("fig_folder_name", "fig") # "" or "figs" or "main"
61
71
  self.bib_folder_name = options.get("bib_folder_name", "bib") # "" or "bibs" or "main"
62
72
  self.md_folder_name = options.get("md_folder_name", "md") # "" or "mds" or "main"
63
73
  self.tex_folder_name = options.get("tex_folder_name", "tex") # "" or "texs" or "main"
@@ -168,9 +178,26 @@ class PyRunBibMdTex(BasicInput):
168
178
  Tuple[List[str], List[str]]: Tuple containing processed Markdown content and LaTeX content.
169
179
  """
170
180
  # Copy figures if enabled
171
- if self.shutil_figures:
172
- figure_names = self.search_figure_names(data_list_md_tex)
173
- self.shutil_copy_figures(self.figure_folder_name, self.figures_directory, figure_names, self.path_output)
181
+ if self.shutil_includegraphics_figs:
182
+ figure_names = self.search_subfile_names(data_list_md_tex, self.includegraphics_figs_postfixes)
183
+ self.shutil_copy_files(
184
+ self.fig_folder_name,
185
+ self.includegraphics_figs_directory,
186
+ figure_names,
187
+ self.path_output,
188
+ self.includegraphics_figs_in_relative_path,
189
+ )
190
+
191
+ # Copy input texs (texes) if enabled
192
+ if self.shutil_input_texs:
193
+ input_tex_names = self.search_subfile_names(data_list_md_tex, self.input_texs_postfixes)
194
+ self.shutil_copy_files(
195
+ self.tex_folder_name,
196
+ self.input_texs_directory,
197
+ input_tex_names,
198
+ self.path_output,
199
+ self.input_texs_in_relative_path,
200
+ )
174
201
 
175
202
  # Extract citation keys from content
176
203
  key_in_md_tex = self.search_cite_keys(data_list_md_tex, self.tex_md_flag)
@@ -217,7 +244,7 @@ class PyRunBibMdTex(BasicInput):
217
244
  data_list_tex,
218
245
  output_tex,
219
246
  self.path_output,
220
- self.figure_folder_name,
247
+ self.fig_folder_name,
221
248
  self.tex_folder_name,
222
249
  self.bib_folder_name,
223
250
  os.path.basename(full_bib_for_abbr),
@@ -238,7 +265,7 @@ class PyRunBibMdTex(BasicInput):
238
265
  return data_list_md, data_list_tex
239
266
 
240
267
  @staticmethod
241
- def search_figure_names(data_list: List[str], figure_postfixes: Optional[List[str]] = None) -> List[str]:
268
+ def search_subfile_names(data_list: List[str], postfixes: List[str]) -> List[str]:
242
269
  """Search for figure filenames in content.
243
270
 
244
271
  Args:
@@ -248,48 +275,69 @@ class PyRunBibMdTex(BasicInput):
248
275
  Returns:
249
276
  List[str]: List of found figure filenames.
250
277
  """
251
- if figure_postfixes is None:
252
- figure_postfixes = ["eps", "jpg", "png", "svg", "psd", "raw", "jpeg", "pdf"]
253
-
254
- regex = re.compile(rf'[\w\-]+\.(?:{"|".join(figure_postfixes)})', re.I)
278
+ regex = re.compile(rf'[\w\-]+\.(?:{"|".join(postfixes)})', re.I)
255
279
  figure_names = []
256
280
  for line in data_list:
257
281
  figure_names.extend(regex.findall(line))
258
282
  return sorted(set(figure_names), key=figure_names.index)
259
283
 
260
284
  @staticmethod
261
- def shutil_copy_figures(fig_folder_name: str, path_fig: str, fig_names: List[str], path_output: str) -> None:
262
- """Copy figure files to output directory.
285
+ def shutil_copy_files(
286
+ file_folder_name: str, path_file: str, file_names: List[str], path_output: str, relative_path: bool
287
+ ) -> None:
288
+ """Copy specified files from source directory to output directory.
289
+
290
+ Searches for files recursively in the source directory and copies them to
291
+ the output location, preserving either relative paths or using a flat structure.
263
292
 
264
293
  Args:
265
- fig_folder_name (str): Name of figures folder in output directory.
266
- path_fig (str): Source directory containing figures.
267
- fig_names (List[str]): List of figure filenames to copy.
268
- path_output (str): Output directory path.
294
+ file_folder_name: Name of the subfolder in output directory (used when relative_path=False).
295
+ path_file: Source directory path to search for files.
296
+ file_names: List of filenames to copy.
297
+ path_output: Destination directory path.
298
+ relative_path: If True, preserves relative path structure; if False, uses flat structure.
299
+
300
+ Returns:
301
+ None: Function executes side effects (file copying) but returns nothing.
269
302
  """
270
- if not fig_names:
303
+ # Early return if no files or invalid source path
304
+ if not file_names or not path_file:
271
305
  return None
272
306
 
273
- if not os.path.exists(path_fig):
274
- print(f"The specified figure directory: {path_fig} does not exist.")
307
+ # Validate source directory exists
308
+ if not os.path.exists(path_file):
309
+ print(f"Source directory does not exist: {path_file}")
275
310
  return None
276
311
 
312
+ # Recursively search for matching files
277
313
  file_list = []
278
- for root, _, files in os.walk(path_fig, topdown=False):
314
+ for root, _, files in os.walk(path_file, topdown=False):
279
315
  for name in files:
280
- if name in fig_names:
316
+ if name in file_names:
281
317
  file_list.append(os.path.join(root, name))
282
318
 
283
- not_founded_figures = list(set([os.path.basename(f) for f in file_list]).intersection(set(fig_names)))
284
- if not_founded_figures:
285
- print(f"Figures: {', '.join(not_founded_figures)} could not be found.")
286
-
287
- for file in file_list:
288
- path_output_file = os.path.join(path_output, fig_folder_name, os.path.basename(file))
289
- p = os.path.dirname(path_output_file)
290
- if not os.path.exists(p):
291
- os.makedirs(p)
292
- shutil.copy(file, path_output_file)
319
+ # Report missing files
320
+ found_files = [os.path.basename(f) for f in file_list]
321
+ not_found = [f for f in file_names if f not in found_files]
322
+ if not_found:
323
+ print(f"Files not found: {', '.join(not_found)}")
324
+
325
+ # Copy each found file to destination
326
+ for file_path in file_list:
327
+ if relative_path:
328
+ # Preserve relative path structure
329
+ path_output_file = file_path.replace(path_file, path_output)
330
+ else:
331
+ # Use flat structure in specified folder
332
+ path_output_file = os.path.join(path_output, file_folder_name, os.path.basename(file_path))
333
+
334
+ # Create destination directory if needed
335
+ output_dir = os.path.dirname(path_output_file)
336
+ if not os.path.exists(output_dir):
337
+ os.makedirs(output_dir)
338
+
339
+ # Perform file copy
340
+ shutil.copy(file_path, path_output_file)
293
341
  return None
294
342
 
295
343
  @staticmethod
@@ -1,14 +1,14 @@
1
1
  [tool.poetry]
2
2
  name = "pyeasyphd"
3
- version = "0.2.2"
3
+ version = "0.2.4"
4
4
  description = "pyeasyphd"
5
5
  license = "GPL-3.0-or-later"
6
6
  authors = ["NextAI <nextartifintell@gmail.com>"]
7
7
  maintainers = ["NextAI <nextartifintell@gmail.com>"]
8
8
  readme = ["README.md"]
9
- homepage = "https://github.com/NextArtifIntell/pyeasyphd"
10
- repository = "https://github.com/NextArtifIntell/pyeasyphd"
11
- documentation = "https://github.com/NextArtifIntell/pyeasyphd"
9
+ homepage = "https://github.com/Easy-PhD/pyeasyphd"
10
+ repository = "https://github.com/Easy-PhD/pyeasyphd"
11
+ documentation = "https://github.com/Easy-PhD/pyeasyphd"
12
12
  keywords = ["Python", "Markdown", "LaTex"]
13
13
  classifiers = ["Topic :: Software Development :: Libraries :: Python Modules"]
14
14
 
File without changes