pyeasyphd 0.1.1__py3-none-any.whl → 0.1.5__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 pyeasyphd might be problematic. Click here for more details.

Files changed (41) hide show
  1. pyeasyphd/__init__.py +5 -0
  2. pyeasyphd/data/Templates/CSL/apa-no-ampersand.csl +2183 -0
  3. pyeasyphd/data/Templates/CSL/apa.csl +2133 -0
  4. pyeasyphd/data/Templates/CSL/ieee.csl +512 -0
  5. pyeasyphd/data/Templates/TEX/Article.tex +38 -0
  6. pyeasyphd/data/Templates/TEX/Article_Header.tex +29 -0
  7. pyeasyphd/data/Templates/TEX/Article_Tail.tex +3 -0
  8. pyeasyphd/data/Templates/TEX/Beamer_Header.tex +80 -0
  9. pyeasyphd/data/Templates/TEX/Beamer_Tail.tex +14 -0
  10. pyeasyphd/data/Templates/TEX/Style.tex +249 -0
  11. pyeasyphd/data/Templates/TEX/TEVC_Header.tex +52 -0
  12. pyeasyphd/data/Templates/TEX/TEVC_Tail.tex +4 -0
  13. pyeasyphd/data/Templates/TEX/eisvogel.beamer +700 -0
  14. pyeasyphd/data/Templates/TEX/eisvogel.latex +1040 -0
  15. pyeasyphd/data/Templates/TEX/eisvogel.tex +1064 -0
  16. pyeasyphd/data/Templates/TEX/math.tex +196 -0
  17. pyeasyphd/data/Templates/TEX/math_commands.tex +673 -0
  18. pyeasyphd/main/__init__.py +6 -7
  19. pyeasyphd/main/basic_input.py +59 -77
  20. pyeasyphd/main/pandoc_md_to.py +48 -47
  21. pyeasyphd/main/python_run_md.py +65 -24
  22. pyeasyphd/main/python_run_tex.py +53 -22
  23. pyeasyphd/pyeasyphd.py +20 -6
  24. pyeasyphd/pyeasyphd.sublime-settings +1 -11
  25. pyeasyphd/tools/__init__.py +5 -8
  26. pyeasyphd/tools/generate/generate_from_bibs.py +41 -37
  27. pyeasyphd/tools/generate/generate_html.py +48 -8
  28. pyeasyphd/tools/generate/generate_library.py +39 -26
  29. pyeasyphd/tools/generate/generate_links.py +14 -8
  30. pyeasyphd/tools/py_run_bib_md_tex.py +60 -112
  31. pyeasyphd/tools/search/data.py +12 -48
  32. pyeasyphd/tools/search/search_base.py +37 -10
  33. pyeasyphd/tools/search/search_core.py +108 -38
  34. pyeasyphd/tools/search/search_keywords.py +18 -16
  35. pyeasyphd/tools/search/search_writers.py +94 -32
  36. pyeasyphd/tools/search/utils.py +48 -9
  37. pyeasyphd/utils/utils.py +7 -6
  38. {pyeasyphd-0.1.1.dist-info → pyeasyphd-0.1.5.dist-info}/METADATA +3 -3
  39. pyeasyphd-0.1.5.dist-info/RECORD +43 -0
  40. pyeasyphd-0.1.1.dist-info/RECORD +0 -27
  41. {pyeasyphd-0.1.1.dist-info → pyeasyphd-0.1.5.dist-info}/WHEEL +0 -0
@@ -1,37 +1,38 @@
1
1
  import os
2
2
  import re
3
+ import shutil
3
4
  import subprocess
4
5
  from typing import Any, Dict, List, Optional
5
6
 
6
- from pyadvtools import (
7
- delete_files,
8
- insert_list_in_list,
9
- read_list,
10
- write_list,
11
- )
7
+ from pyadvtools import delete_files, insert_list_in_list, read_list, write_list
12
8
 
13
9
  from .basic_input import BasicInput
14
10
 
15
11
 
16
12
  class PythonRunTex(BasicInput):
17
- """Python tex.
13
+ """Python LaTeX processing class.
18
14
 
19
15
  Args:
20
- options (Dict[str, Any]): Options.
16
+ options (Dict[str, Any]): Configuration options.
21
17
 
22
18
  Attributes:
23
- run_latex (bool = False): Whether to run latex.
24
- pdflatex_xelatex (str = "pdflatex"): pdflatex or xelatex.
25
- delete_run_latex_cache (bool = True): Whether to delete run latex cache.
19
+ run_latex (bool): Whether to run LaTeX compilation. Defaults to False.
20
+ pdflatex_xelatex (str): LaTeX engine to use ('pdflatex' or 'xelatex'). Defaults to "pdflatex".
21
+ delete_run_latex_cache (bool): Whether to delete LaTeX cache files. Defaults to True.
26
22
  """
27
23
 
28
24
  def __init__(self, options: Dict[str, Any]) -> None:
25
+ """Initialize PythonRunTex with configuration options.
26
+
27
+ Args:
28
+ options (Dict[str, Any]): Configuration options.
29
+ """
29
30
  super().__init__(options)
30
31
 
31
32
  # for tex
32
33
  self.final_output_main_tex_name: str = options.get("final_output_main_tex_name", "")
33
34
  self.run_latex: bool = options.get("run_latex", False)
34
- self.pdflatex_xelatex: str = options.get("pdflatex_xelatex", "pdflatex") # pdflatex, xelatex
35
+ self.pdflatex_xelatex: str = options.get("pdflatex_xelatex", "xelatex") # pdflatex, xelatex
35
36
  self.delete_run_latex_cache: bool = options.get("delete_run_latex_cache", True)
36
37
  self.latex_clean_file_types: Optional[List[str]] = options.get("latex_clean_file_types", None)
37
38
 
@@ -46,10 +47,27 @@ class PythonRunTex(BasicInput):
46
47
  bib_name: str = "abbr.bib",
47
48
  template_name: str = "article",
48
49
  ) -> List[str]:
50
+ """Generate standard LaTeX data list with proper formatting.
51
+
52
+ Args:
53
+ data_list_body (List[str]): List of body content strings.
54
+ output_tex_name (str): Name of output LaTeX file.
55
+ path_output (str): Path to output directory.
56
+ figure_folder_name (str, optional): Name of figures folder. Defaults to "figs".
57
+ tex_folder_name (str, optional): Name of LaTeX folder. Defaults to "tex".
58
+ bib_folder_name (str, optional): Name of bibliography folder. Defaults to "bib".
59
+ bib_name (str, optional): Name of bibliography file. Defaults to "abbr.bib".
60
+ template_name (str, optional): Name of template to use. Defaults to "article".
61
+
62
+ Returns:
63
+ List[str]: List of processed LaTeX content strings.
64
+ """
49
65
  # for figures
50
66
  for i in range(len(data_list_body)):
51
67
  if re.search(r"\\includegraphics", data_list_body[i]):
52
- data_list_body[i] = data_list_body[i].replace(f".{os.sep}Figures{os.sep}", f".{os.sep}{figure_folder_name}{os.sep}")
68
+ data_list_body[i] = data_list_body[i].replace(
69
+ f".{os.sep}Figures{os.sep}", f".{os.sep}{figure_folder_name}{os.sep}"
70
+ )
53
71
  data_list_body[i] = data_list_body[i].replace(f"Figures{os.sep}", f"{figure_folder_name}{os.sep}")
54
72
  write_list(data_list_body, output_tex_name, "w", os.path.join(path_output, tex_folder_name), False)
55
73
 
@@ -58,7 +76,6 @@ class PythonRunTex(BasicInput):
58
76
  )
59
77
  return data_list_body
60
78
 
61
- # for tex files
62
79
  def _special_operate_tex(
63
80
  self,
64
81
  data_list_body: List[str],
@@ -69,6 +86,17 @@ class PythonRunTex(BasicInput):
69
86
  bib_folder_name: str,
70
87
  bib_name: str,
71
88
  ) -> None:
89
+ """Perform special operations on LaTeX files.
90
+
91
+ Args:
92
+ data_list_body (List[str]): List of body content strings.
93
+ template_name (str): Name of template to use.
94
+ output_tex_name (str): Name of output LaTeX file.
95
+ path_output (str): Path to output directory.
96
+ tex_folder_name (str): Name of LaTeX folder.
97
+ bib_folder_name (str): Name of bibliography folder.
98
+ bib_name (str): Name of bibliography file.
99
+ """
72
100
  # read template data
73
101
  template_h, template_t = [], []
74
102
  if template_name.lower() == "paper":
@@ -133,19 +161,22 @@ class PythonRunTex(BasicInput):
133
161
 
134
162
  # run latex
135
163
  if self.run_latex:
136
- os.chdir(path_output)
137
- cmd = "latexmk -{} {}".format(self.pdflatex_xelatex, main_name)
138
- try:
139
- subprocess.run(cmd, shell=True, check=True, capture_output=True, text=True)
140
- except subprocess.CalledProcessError as e:
141
- print("Error in Run LaTex:", e.stderr)
164
+ if shutil.which("latexmk"):
165
+ os.chdir(path_output)
166
+ cmd = "latexmk -{} {}".format(self.pdflatex_xelatex, main_name)
167
+ try:
168
+ subprocess.run(cmd.split(), check=True, capture_output=True, text=True)
169
+ except subprocess.CalledProcessError as e:
170
+ print("Error in Run LaTex:", e.stderr)
171
+ else:
172
+ print("latexmk not found. Please install Texlive.")
142
173
 
143
174
  # delete cache
144
175
  if self.delete_run_latex_cache:
145
176
  if self.latex_clean_file_types is not None:
146
177
  postfix = self.latex_clean_file_types
147
178
  else:
148
- postfix = ['.aux', '.bbl', '.bcf', '.blg', '.fdb_latexmk', '.fls', '.log', '.out', '.run.xml']
149
- postfix.extend(['.synctex.gz', '.gz', '.nav', '.snm', '.toc', '.xdv'])
179
+ postfix = [".aux", ".bbl", ".bcf", ".blg", ".fdb_latexmk", ".fls", ".log", ".out", ".run.xml"]
180
+ postfix.extend([".synctex.gz", ".gz", ".nav", ".snm", ".toc", ".xdv"])
150
181
  delete_files(path_output, postfix)
151
182
  return None
pyeasyphd/pyeasyphd.py CHANGED
@@ -8,7 +8,12 @@ from pyeasyphd.tools.py_run_bib_md_tex import PyRunBibMdTex
8
8
 
9
9
 
10
10
  def delete_files(path_storage: str, extensions) -> None:
11
- """Delete."""
11
+ """Delete files with specified extensions from storage path.
12
+
13
+ Args:
14
+ path_storage (str): Path to the storage directory.
15
+ extensions: List of file extensions to delete.
16
+ """
12
17
  for name in os.listdir(path_storage):
13
18
  for ext in extensions:
14
19
  if name.endswith(ext) and os.path.isfile(os.path.join(path_storage, name)):
@@ -16,7 +21,16 @@ def delete_files(path_storage: str, extensions) -> None:
16
21
 
17
22
 
18
23
  class PypapersCommand(sublime_plugin.WindowCommand):
24
+ """Sublime Text command for processing papers with various templates."""
25
+
19
26
  def run(self, template="Paper", output_level="next", delete_cache=False):
27
+ """Run the paper processing command.
28
+
29
+ Args:
30
+ template (str, optional): Template type to use. Defaults to "Paper".
31
+ output_level (str, optional): Output level for processing. Defaults to "next".
32
+ delete_cache (bool, optional): Whether to delete cache files. Defaults to False.
33
+ """
20
34
  vars_dict = self.window.extract_variables()
21
35
 
22
36
  packages_path = vars_dict["packages"]
@@ -48,13 +62,13 @@ class PypapersCommand(sublime_plugin.WindowCommand):
48
62
  options[key] = os.path.expandvars(os.path.expanduser(options[key]))
49
63
 
50
64
  if delete_cache:
51
- file_path = vars_dict['file_path']
65
+ file_path = vars_dict["file_path"]
52
66
 
53
- if latex_clean_file_types := options.get('latex_clean_file_types', []):
67
+ if latex_clean_file_types := options.get("latex_clean_file_types", []):
54
68
  postfix = latex_clean_file_types
55
69
  else:
56
- postfix = ['.aux', '.bbl', '.bcf', '.blg', '.fdb_latexmk', '.fls', '.log', '.out', '.run.xml']
57
- postfix.extend(['.synctex.gz', '.gz', '.nav', '.snm', '.toc', '.xdv'])
70
+ postfix = [".aux", ".bbl", ".bcf", ".blg", ".fdb_latexmk", ".fls", ".log", ".out", ".run.xml"]
71
+ postfix.extend([".synctex.gz", ".gz", ".nav", ".snm", ".toc", ".xdv"])
58
72
 
59
73
  delete_files(file_path, postfix)
60
74
  delete_files(os.path.dirname(file_path), postfix)
@@ -69,4 +83,4 @@ class PypapersCommand(sublime_plugin.WindowCommand):
69
83
  p_r_l_m.run_files([vars_dict["file"]], vars_dict["file_base_name"], output_level)
70
84
 
71
85
  # display
72
- self.window.status_message('Successful.')
86
+ self.window.status_message("Successful.")
@@ -1,14 +1,4 @@
1
1
  {
2
- // config
3
- // config path
4
- // Must be configured by the user.
5
- "path_config": "",
6
-
7
- // figures, templates, bibs
8
- "path_bibs": "",
9
- "path_figures": "",
10
- "path_templates": "",
11
-
12
2
  // pyeasyphd/main/pandoc_md_to.py
13
3
  // for pandoc
14
4
  "csl_name": "apa-no-ampersand",
@@ -47,7 +37,7 @@
47
37
  // true, false
48
38
  "run_latex": false,
49
39
  // "pdflatex", "xelatex"
50
- "pdflatex_xelatex": "pdflatex",
40
+ "pdflatex_xelatex": "xelatex",
51
41
  // true, false
52
42
  "delete_run_latex_cache": true,
53
43
  "latex_clean_file_types": [
@@ -1,13 +1,10 @@
1
- """Initialization."""
1
+ """Tools module for PyEasyPhD advanced functionality.
2
2
 
3
- __all__ = [
4
- "PyRunBibMdTex",
3
+ This module provides advanced tools for bibliography processing,
4
+ search functionality, and content generation.
5
+ """
5
6
 
6
- "Searchkeywords",
7
-
8
- "generate_from_bibs_and_write",
9
- "PaperLinksGenerator",
10
- ]
7
+ __all__ = ["PyRunBibMdTex", "Searchkeywords", "generate_from_bibs_and_write", "PaperLinksGenerator"]
11
8
 
12
9
  from .generate.generate_from_bibs import generate_from_bibs_and_write
13
10
  from .generate.generate_links import PaperLinksGenerator
@@ -5,7 +5,7 @@ from typing import Any, Dict, List, Union
5
5
  from pyadvtools import standard_path, write_list
6
6
  from pybibtexer.tools.experiments_base import generate_standard_publisher_abbr_options_dict
7
7
 
8
- from ...main import BasicInput, PandocMdTo
8
+ from ...main import PandocMdTo
9
9
  from .generate_html import generate_html_content, generate_html_from_bib_data
10
10
  from .generate_library import generate_library_by_filters
11
11
 
@@ -21,20 +21,26 @@ def preparation(
21
21
  ):
22
22
  """Prepare paths and flags for data generation.
23
23
 
24
- Examples
25
- --------
26
- | | current_issue | current_month | all_months |
27
- |--------------|---------------|---------------|------------|
28
- | current_year | YES | YES | YES |
29
- | all_years | NO | NO | YES |
30
- | given_years | NO | NO | YES |
31
-
32
- given_years = ["2020", "2025"]
33
-
34
- Returns
35
- -------
36
- Tuple[str, str, bool]
37
- Returns (path_root, path_output, combine_flag)
24
+ Args:
25
+ path_storage (str): Path to storage directory.
26
+ path_output (str): Path to output directory.
27
+ output_basename (str): Base name for output files.
28
+ pub_type (str): Type of publication.
29
+ issue_or_month_flag (Union[str, List[str]], optional): Issue or month flag. Defaults to "current_issue".
30
+ year_flag (Union[str, List[str]], optional): Year flag. Defaults to "current_year".
31
+ options (Dict[str, Any], optional): Additional options. Defaults to {}.
32
+
33
+ Examples:
34
+ | | current_issue | current_month | all_months |
35
+ |--------------|---------------|---------------|------------|
36
+ | current_year | YES | YES | YES |
37
+ | all_years | NO | NO | YES |
38
+ | given_years | NO | NO | YES |
39
+
40
+ given_years = ["2020", "2025"]
41
+
42
+ Returns:
43
+ Tuple[str, str, bool]: Returns (path_root, path_output, combine_flag).
38
44
  """
39
45
  # default settings
40
46
  path_storage = standard_path(path_storage)
@@ -77,31 +83,20 @@ def generate_from_bibs_and_write(
77
83
  ) -> None:
78
84
  """Generate or combine data from bibliographies.
79
85
 
80
- Parameters
81
- ----------
82
- path_storage : str
83
- Path to storage directory
84
- path_output : str
85
- Path to output directory
86
- generate_or_combine : str
87
- Either "generate_data" or "combine_data"
88
- year_flag : Union[str, List[str]], optional
89
- Flag for year selection, by default "current_year"
90
- issue_or_month_flag : Union[str, List[str]], optional
91
- Flag for issue/month selection, by default "current_issue"
92
- options : Dict[str, Any], optional
93
- Additional options, by default {}
86
+ Args:
87
+ path_storage (str): Path to storage directory.
88
+ path_output (str): Path to output directory.
89
+ output_basename (str): Base name for output files.
90
+ pub_type (str): Type of publication.
91
+ generate_or_combine (str): Either "generate_data" or "combine_data".
92
+ year_flag (Union[str, List[str]], optional): Flag for year selection. Defaults to "current_year".
93
+ issue_or_month_flag (Union[str, List[str]], optional): Flag for issue/month selection. Defaults to "current_issue".
94
+ options (Dict[str, Any], optional): Additional options. Defaults to {}.
94
95
  """
95
96
  path_root, path_output, combine_flag = preparation(
96
97
  path_storage, path_output, output_basename, pub_type, issue_or_month_flag, year_flag, options
97
98
  )
98
99
 
99
- # Default settings
100
- x = BasicInput(options)
101
- options = x.options
102
- full_json_c = x.full_json_c
103
- full_json_j = x.full_json_j
104
-
105
100
  if generate_or_combine == "generate_data":
106
101
  publisher_abbr_dict = generate_standard_publisher_abbr_options_dict(path_storage, options)
107
102
  for publisher in publisher_abbr_dict:
@@ -123,11 +118,11 @@ def generate_from_bibs_and_write(
123
118
 
124
119
  # Generate and process library
125
120
  library = generate_library_by_filters(
126
- path_abbr, issue_or_month_flag, year_flag, new_options, full_json_c, full_json_j
121
+ path_abbr, issue_or_month_flag, year_flag, new_options
127
122
  )
128
123
 
129
124
  # Generate md, tex, pdf, html
130
- html_body = generate_html_from_bib_data(abbr, library, pp, new_options, full_json_c, full_json_j)
125
+ html_body = generate_html_from_bib_data(abbr, library, pp, new_options)
131
126
  if combine_flag and html_body:
132
127
  publisher_html_body.extend(html_body + ["\n"])
133
128
 
@@ -143,6 +138,15 @@ def generate_from_bibs_and_write(
143
138
 
144
139
 
145
140
  def _combine_data(path_storage, path_root, path_output, combine_flag, options):
141
+ """Combine data from multiple sources.
142
+
143
+ Args:
144
+ path_storage: Path to storage directory.
145
+ path_root: Root path for output.
146
+ path_output: Path to output directory.
147
+ combine_flag: Flag indicating whether to combine data.
148
+ options: Configuration options.
149
+ """
146
150
  # Compulsory
147
151
  options["include_abbr_list"] = []
148
152
  options["exclude_abbr_list"] = []
@@ -9,7 +9,15 @@ from ...utils.utils import html_head, html_style, html_tail, textarea_header, te
9
9
 
10
10
 
11
11
  def generate_html_content(html_body, abbr_standard):
12
- """Create complete HTML document from body content."""
12
+ """Create complete HTML document from body content.
13
+
14
+ Args:
15
+ html_body: List of HTML body content lines.
16
+ abbr_standard (str): Standard abbreviation for the document.
17
+
18
+ Returns:
19
+ List[str]: Complete HTML document as list of lines.
20
+ """
13
21
  return [html_head.format(abbr_standard), html_style, "\n"] + html_body + [html_tail]
14
22
 
15
23
 
@@ -18,10 +26,20 @@ def generate_html_from_bib_data(
18
26
  original_bib_data: Union[List[str], str, Library],
19
27
  path_output: str,
20
28
  options: Dict[str, Any] = {},
21
- full_json_c: str = "",
22
- full_json_j: str = ""
23
29
  ) -> List[str]:
24
- """Generate html from bibliography data."""
30
+ """Generate HTML from bibliography data.
31
+
32
+ Args:
33
+ abbr_standard (str): Standard abbreviation for the publication.
34
+ original_bib_data (Union[List[str], str, Library]): Bibliography data in various formats.
35
+ path_output (str): Path to output directory.
36
+ options (Dict[str, Any], optional): Additional processing options. Defaults to {}.
37
+ full_json_c (str, optional): Path to conferences JSON file. Defaults to "".
38
+ full_json_j (str, optional): Path to journals JSON file. Defaults to "".
39
+
40
+ Returns:
41
+ List[str]: List of HTML body content lines.
42
+ """
25
43
  # Set processing options
26
44
  processing_options: dict = {
27
45
  # convert_str_to_library
@@ -49,10 +67,10 @@ def generate_html_from_bib_data(
49
67
  processing_options.update(options)
50
68
 
51
69
  # Process bibliography data
52
- _python_bib = PythonRunBib(full_json_c, full_json_j, processing_options)
70
+ _python_bib = PythonRunBib(processing_options)
53
71
  _, zotero_library, _ = _python_bib.parse_to_multi_standard_library(original_bib_data)
54
72
 
55
- _python_writer = PythonWriters(full_json_c, full_json_j, processing_options)
73
+ _python_writer = PythonWriters(processing_options)
56
74
 
57
75
  # Generate HTML content for each entry
58
76
  html_body = []
@@ -77,7 +95,16 @@ def generate_html_from_bib_data(
77
95
 
78
96
 
79
97
  def _format_entry_to_html(entry, abbr, data_list):
80
- """Format a single bibliography entry into HTML."""
98
+ """Format a single bibliography entry into HTML.
99
+
100
+ Args:
101
+ entry: Bibliography entry dictionary.
102
+ abbr (str): Publication abbreviation.
103
+ data_list: List of formatted bibliography data.
104
+
105
+ Returns:
106
+ str: HTML formatted entry string.
107
+ """
81
108
  # Extract entry fields
82
109
  number = entry["number"] if "number" in entry else ""
83
110
  pages = entry["pages"] if "pages" in entry else ""
@@ -103,7 +130,20 @@ def _format_entry_to_html(entry, abbr, data_list):
103
130
 
104
131
 
105
132
  def _format_entry_to_apa_style(title, year, volume, number, pages, url, abbr):
106
- """Format entry in APA citation style."""
133
+ """Format entry in APA citation style.
134
+
135
+ Args:
136
+ title (str): Article title.
137
+ year (str): Publication year.
138
+ volume (str): Journal volume.
139
+ number (str): Issue number.
140
+ pages (str): Page numbers.
141
+ url (str): Article URL.
142
+ abbr (str): Publication abbreviation.
143
+
144
+ Returns:
145
+ str: APA formatted citation string.
146
+ """
107
147
  line = f"({year}). {title}. <em>{abbr}</em>"
108
148
 
109
149
  if volume:
@@ -10,30 +10,19 @@ def generate_library_by_filters(
10
10
  issue_or_month_flag: Union[str, List[str]], # filter
11
11
  year_flag: Union[str, List[str]] = "current_year", # filter
12
12
  options: Dict[str, Any] = {},
13
- full_json_c: str = "",
14
- full_json_j: str = ""
15
13
  ) -> Library:
16
14
  """Generate a Library object from input data with given filters.
17
15
 
18
- Parameters
19
- ----------
20
- original_data : Union[List[str], str, Library]
21
- Input bibliography data
22
- issue_or_month_flag : Union[str, List[str]]
23
- Flag for issue/month selection
24
- year_flag : Union[str, List[str]], optional
25
- Flag for year selection, by default "current_year"
26
- options : Dict[str, Any], optional
27
- Additional options, by default {}
28
- full_json_c : str, optional
29
- JSON configuration for conference proceedings, by default "".
30
- full_json_j : str, optional
31
- JSON configuration for journal articles, by default "".
32
-
33
- Returns
34
- -------
35
- Library
36
- Processed library object
16
+ Args:
17
+ original_data (Union[List[str], str, Library]): Input bibliography data.
18
+ issue_or_month_flag (Union[str, List[str]]): Flag for issue/month selection.
19
+ year_flag (Union[str, List[str]], optional): Flag for year selection. Defaults to "current_year".
20
+ options (Dict[str, Any], optional): Additional options. Defaults to {}.
21
+ full_json_c (str, optional): JSON configuration for conference proceedings. Defaults to "".
22
+ full_json_j (str, optional): JSON configuration for journal articles. Defaults to "".
23
+
24
+ Returns:
25
+ Library: Processed library object.
37
26
  """
38
27
  _options = {}
39
28
  # convert_str_to_library
@@ -62,7 +51,7 @@ def generate_library_by_filters(
62
51
  _options["substitute_in_bib"] = False # default is True
63
52
 
64
53
  _options.update(options)
65
- _python_bib = PythonRunBib(full_json_c, full_json_j, _options)
54
+ _python_bib = PythonRunBib(_options)
66
55
 
67
56
  # Generate nested entries dictionary
68
57
  entry_type_year_volume_number_month_entry_dict = _python_bib.parse_to_nested_entries_dict(original_data)
@@ -87,7 +76,15 @@ def _obtain_year_flag_library(
87
76
  nested_entries: Dict[str, Dict[str, Dict[str, Dict[str, Dict[str, List[Entry]]]]]],
88
77
  year_flag: Union[str, List[str]] = "current_year",
89
78
  ):
90
- """Filter dict by year flag."""
79
+ """Filter dictionary by year flag.
80
+
81
+ Args:
82
+ nested_entries: Nested dictionary containing bibliography entries.
83
+ year_flag (Union[str, List[str]], optional): Year filter flag. Defaults to "current_year".
84
+
85
+ Returns:
86
+ Dict: Filtered dictionary by year.
87
+ """
91
88
  new_dict = {}
92
89
  for entry_type in nested_entries:
93
90
  years = [year for year in nested_entries[entry_type]]
@@ -111,9 +108,17 @@ def _obtain_year_flag_library(
111
108
 
112
109
  def _obtain_issue_flag_library(
113
110
  nested_entries: Dict[str, Dict[str, Dict[str, Dict[str, Dict[str, List[Entry]]]]]],
114
- issue_flag: str = "current_issue"
111
+ issue_flag: str = "current_issue",
115
112
  ) -> Library:
116
- """Filter dict by issue flag."""
113
+ """Filter dictionary by issue flag.
114
+
115
+ Args:
116
+ nested_entries: Nested dictionary containing bibliography entries.
117
+ issue_flag (str, optional): Issue filter flag. Defaults to "current_issue".
118
+
119
+ Returns:
120
+ Library: Filtered library object.
121
+ """
117
122
  nested_entries = IterateSortDict(True).dict_update(nested_entries)
118
123
 
119
124
  entries = []
@@ -149,7 +154,15 @@ def _obtain_month_flag_library(
149
154
  nested_entries: Dict[str, Dict[str, Dict[str, Dict[str, Dict[str, List[Entry]]]]]],
150
155
  month_flag: Union[str, List[str]] = "current_month",
151
156
  ) -> Library:
152
- """Filter dict by month flag."""
157
+ """Filter dictionary by month flag.
158
+
159
+ Args:
160
+ nested_entries: Nested dictionary containing bibliography entries.
161
+ month_flag (Union[str, List[str]], optional): Month filter flag. Defaults to "current_month".
162
+
163
+ Returns:
164
+ Library: Filtered library object.
165
+ """
153
166
  new_dict = {}
154
167
  for entry_type in nested_entries:
155
168
  for year in nested_entries[entry_type]:
@@ -19,12 +19,14 @@ class PaperLinksGenerator(object):
19
19
  keywords_category_name: str = "",
20
20
  display_year_period: int = 10,
21
21
  ):
22
- """
23
- Initialize the generator with base paths.
22
+ """Initialize the generator with base paths.
24
23
 
25
24
  Args:
26
- json_base_path: Path to JSON files directory
27
- data_base_path: Path to data files directory
25
+ full_json_c (str): Path to conferences JSON file.
26
+ full_json_j (str): Path to journals JSON file.
27
+ data_base_path (str): Path to data files directory.
28
+ keywords_category_name (str, optional): Category name for keywords. Defaults to "".
29
+ display_year_period (int, optional): Number of years to display. Defaults to 10.
28
30
  """
29
31
  self.full_json_c = full_json_c
30
32
  self.full_json_j = full_json_j
@@ -46,11 +48,11 @@ class PaperLinksGenerator(object):
46
48
  self.display_year_period = display_year_period
47
49
 
48
50
  def generate_yearly_links(self, cj: str, folder_name=os.path.join("data", "Yearly")) -> None:
49
- """
50
- Generate yearly markdown table with paper links.
51
+ """Generate yearly markdown table with paper links.
51
52
 
52
53
  Args:
53
- cj: Publication type - 'conferences' or 'journals'
54
+ cj (str): Publication type - 'conferences' or 'journals'.
55
+ folder_name (str, optional): Output folder name. Defaults to "data/Yearly".
54
56
  """
55
57
  flags = self._get_yearly_flags(cj)
56
58
  folder_flags = [f"{f}_all_months" for f in flags]
@@ -58,7 +60,11 @@ class PaperLinksGenerator(object):
58
60
  self._generate_links(cj, flags, folder_flags, folder_name)
59
61
 
60
62
  def generate_weekly_links(self, folder_name=os.path.join("data", "Weekly")) -> None:
61
- """Generate weekly markdown table with journal paper links."""
63
+ """Generate weekly markdown table with journal paper links.
64
+
65
+ Args:
66
+ folder_name (str, optional): Output folder name. Defaults to "data/Weekly".
67
+ """
62
68
  cj = "Journals"
63
69
 
64
70
  flags = ["Current Issue", "Current Month", "All Months"]