pyeasyphd 0.0.7__tar.gz → 0.0.9__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 (80) hide show
  1. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/PKG-INFO +3 -2
  2. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/main/basic_input.py +39 -11
  3. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/tools/compare/compare_bibs.py +1 -1
  4. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/tools/generate/generate_from_bibs.py +8 -6
  5. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/tools/generate/generate_links.py +48 -35
  6. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/tools/spider/process_spider_url.py +2 -1
  7. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyproject.toml +1 -1
  8. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/README.md +0 -0
  9. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/.python-version +0 -0
  10. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/Main.sublime-menu +0 -0
  11. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/__init__.py +0 -0
  12. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/__init__.py +0 -0
  13. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexbase/__init__.py +0 -0
  14. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexbase/standardize/_base.py +0 -0
  15. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexbase/standardize/default_data.py +0 -0
  16. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexbase/standardize/do_on_bib.py +0 -0
  17. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexbase/standardize/do_on_comment_block.py +0 -0
  18. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexbase/standardize/do_on_entry_block.py +0 -0
  19. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexbase/standardize/do_on_preamble_block.py +0 -0
  20. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexbase/standardize/do_on_string_block.py +0 -0
  21. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexbase/standardize_bib.py +0 -0
  22. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/__init__.py +0 -0
  23. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/bibtex_format.py +0 -0
  24. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/exceptions.py +0 -0
  25. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/library.py +0 -0
  26. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/middlewares/block/add.py +0 -0
  27. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/middlewares/block/authors.py +0 -0
  28. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/middlewares/block/doi_url.py +0 -0
  29. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/middlewares/block/entry_field_keys_normalize.py +0 -0
  30. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/middlewares/block/entry_field_keys_replace.py +0 -0
  31. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/middlewares/block/entry_field_values_normalize.py +0 -0
  32. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/middlewares/block/entry_fields_delete.py +0 -0
  33. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/middlewares/block/entry_fields_keep.py +0 -0
  34. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/middlewares/block/entry_fields_sort.py +0 -0
  35. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/middlewares/block/entry_types.py +0 -0
  36. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/middlewares/block/journal_booktitle.py +0 -0
  37. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/middlewares/block/month_year.py +0 -0
  38. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/middlewares/block/number_volume.py +0 -0
  39. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/middlewares/block/pages.py +0 -0
  40. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/middlewares/block/title.py +0 -0
  41. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/middlewares/library/generating_entrykeys.py +0 -0
  42. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/middlewares/library/keeping_blocks.py +0 -0
  43. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/middlewares/library/sorting_blocks.py +0 -0
  44. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/middlewares/middleware.py +0 -0
  45. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/middlewares/parsestack.py +0 -0
  46. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/middlewares/utils.py +0 -0
  47. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/middlewares_library_to_library.py +0 -0
  48. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/middlewares_library_to_str.py +0 -0
  49. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/middlewares_str_to_library.py +0 -0
  50. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/middlewares_str_to_str.py +0 -0
  51. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/model.py +0 -0
  52. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/bibtexparser/splitter.py +0 -0
  53. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/core/__init__.py +0 -0
  54. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/core/convert_library_to_library.py +0 -0
  55. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/core/convert_library_to_str.py +0 -0
  56. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/core/convert_str_to_library.py +0 -0
  57. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/bib/core/convert_str_to_str.py +0 -0
  58. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/main/__init__.py +0 -0
  59. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/main/pandoc_md_to.py +0 -0
  60. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/main/python_run_bib.py +0 -0
  61. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/main/python_run_md.py +0 -0
  62. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/main/python_run_tex.py +0 -0
  63. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/main/python_writers.py +0 -0
  64. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/pyeasyphd.py +0 -0
  65. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/pyeasyphd.sublime-settings +0 -0
  66. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/pyeasyphd.sublime-syntax +0 -0
  67. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/tools/__init__.py +0 -0
  68. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/tools/experiments_base.py +0 -0
  69. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/tools/format_save_bibs.py +0 -0
  70. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/tools/py_run_bib_md_tex.py +0 -0
  71. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/tools/replace/replace.py +0 -0
  72. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/tools/search/data.py +0 -0
  73. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/tools/search/search_base.py +0 -0
  74. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/tools/search/search_core.py +0 -0
  75. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/tools/search/search_keywords.py +0 -0
  76. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/tools/search/search_writers.py +0 -0
  77. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/tools/search/utils.py +0 -0
  78. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/tools/spider/process_spider_bib.py +0 -0
  79. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/tools/spider/process_spider_url_bib.py +0 -0
  80. {pyeasyphd-0.0.7 → pyeasyphd-0.0.9}/pyeasyphd/utils/utils.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: pyeasyphd
3
- Version: 0.0.7
3
+ Version: 0.0.9
4
4
  Summary: pyeasyphd
5
5
  License: GPL-3.0-or-later
6
6
  Keywords: Python,Markdown,LaTex
@@ -16,6 +16,7 @@ Classifier: Programming Language :: Python :: 3.10
16
16
  Classifier: Programming Language :: Python :: 3.11
17
17
  Classifier: Programming Language :: Python :: 3.12
18
18
  Classifier: Programming Language :: Python :: 3.13
19
+ Classifier: Programming Language :: Python :: 3.14
19
20
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
21
  Requires-Dist: pyadvtools (>=0.0.5,<0.0.6)
21
22
  Project-URL: Documentation, https://github.com/NextArtifIntell/pyeasyphd
@@ -45,13 +45,19 @@ class BasicInput(object):
45
45
  # Update
46
46
  path_config = standard_path(options.get("path_config", ""))
47
47
  if len(self.path_bibs) == 0:
48
- for folder in ["bib", "bibs", "Bib", "Bibs", "BIB", "BIBS"]:
48
+ for folder in [
49
+ "bib", "bibs", "Bib", "Bibs", "BIB", "BIBS",
50
+ "reference", "references", "Reference", "References", "REFERENCE", "REFERENCES"
51
+ ]:
49
52
  if os.path.exists(p := os.path.join(path_config, folder)):
50
53
  self.path_bibs = p
51
54
  break
52
55
 
53
56
  if len(self.path_figures) == 0:
54
- for folder in ["figure", "figures", "Figure", "Figures", "FIGURE", "FIGURES"]:
57
+ for folder in [
58
+ "figure", "figures", "Figure", "Figures", "FIGURE", "FIGURES",
59
+ "fig", "figs", "Fig", "Figs", "FIG", "FIGS",
60
+ ]:
55
61
  if os.path.exists(p := os.path.join(path_config, folder)):
56
62
  self.path_figures = p
57
63
  break
@@ -128,18 +134,26 @@ class BasicInput(object):
128
134
  csl_name = options.get("csl_name", "apa-no-ampersand")
129
135
  if len(csl_name) == 0:
130
136
  csl_name = "apa-no-ampersand"
131
- self.full_csl_style_pandoc = os.path.join(self.path_templates, "CSL", f"{csl_name}.csl")
132
- self.full_tex_article_template_pandoc = os.path.join(self.path_templates, "TEX", "eisvogel.tex")
133
137
 
134
- self.article_template_tex = read_list(os.path.join(self.path_templates, "TEX", "Article.tex"))
138
+ full_csl_style_pandoc = os.path.join(self.path_templates, "CSL", f"{csl_name}.csl")
139
+ if (p := options.get("full_csl")) is not None:
140
+ full_csl_style_pandoc = p
141
+ self.full_csl_style_pandoc = full_csl_style_pandoc
142
+
143
+ full_tex_article_template_pandoc = os.path.join(self.path_templates, "TEX", "eisvogel.tex")
144
+ if (p := options.get("full_eisvogel")) is not None:
145
+ full_tex_article_template_pandoc = p
146
+ self.full_tex_article_template_pandoc = full_tex_article_template_pandoc
147
+
148
+ self.article_template_tex = self._try_read_list(options, "TEX", "Article.tex", "full_article")
135
149
 
136
150
  def _initialize_python_run_tex(self, options: Dict[str, Any]) -> None:
137
- self.article_template_header_tex = read_list(os.path.join(self.path_templates, "TEX", "Article_Header.tex"))
138
- self.article_template_tail_tex = read_list(os.path.join(self.path_templates, "TEX", "Article_Tail.tex"))
139
- self.beamer_template_header_tex = read_list(os.path.join(self.path_templates, "TEX", "Beamer_Header.tex"))
140
- self.beamer_template_tail_tex = read_list(os.path.join(self.path_templates, "TEX", "Beamer_Tail.tex"))
141
- self.math_commands_tex = read_list(os.path.join(self.path_templates, "TEX", "math_commands.tex"))
142
- self.usepackages_tex = read_list(os.path.join(self.path_templates, "TEX", "Style.tex"))
151
+ self.article_template_header_tex = self._try_read_list(options, "TEX", "Article_Header.tex", "full_article_header")
152
+ self.article_template_tail_tex = self._try_read_list(options, "TEX", "Article_Tail.tex", "full_article_tail")
153
+ self.beamer_template_header_tex = self._try_read_list(options, "TEX", "Beamer_Header.tex", "full_beamer_header")
154
+ self.beamer_template_tail_tex = self._try_read_list(options, "TEX", "Beamer_Tail.tex", "full_beamer_tail")
155
+ self.math_commands_tex = self._try_read_list(options, "TEX", "math_commands.tex", "full_math_commands")
156
+ self.usepackages_tex = self._try_read_list(options, "TEX", "Style.tex", "full_usepackages_tex")
143
157
 
144
158
  # handly preamble
145
159
  self.handly_preamble = options.get("handly_preamble", False)
@@ -147,3 +161,17 @@ class BasicInput(object):
147
161
  self.article_template_header_tex, self.article_template_tail_tex = [], []
148
162
  self.beamer_template_header_tex, self.beamer_template_tail_tex = [], []
149
163
  self.math_commands_tex, self.usepackages_tex = [], []
164
+
165
+ def _try_read_list(self, options: Dict[str, Any], folder_name: str, file_name: str, key: str):
166
+ path_file = os.path.join(self.path_templates, folder_name, file_name)
167
+ if (p := options.get(key)) is None:
168
+ return []
169
+ else:
170
+ path_file = p
171
+
172
+ try:
173
+ data_list = read_list(path_file)
174
+ except Exception as e:
175
+ print(e)
176
+ data_list = []
177
+ return data_list
@@ -127,7 +127,7 @@ def _compare_with_local(
127
127
  if len(data_list := transform_to_data_list(path_abbr, ".bib")) == 0:
128
128
  continue
129
129
 
130
- print("*" * 9 + f" Compare in {'/'.join(path_abbr.split('/')[-3:])} for {abbr} " + "*" * 9)
130
+ print("*" * 9 + f" Compare in {f'{os.sep}'.join(path_abbr.split(os.sep)[-3:])} for {abbr} " + "*" * 9)
131
131
 
132
132
  _options = {}
133
133
  _options["is_standardize_bib"] = False # default is True
@@ -47,10 +47,10 @@ def preparation(
47
47
  im = "-".join(issue_or_month_flag) if isinstance(issue_or_month_flag, List) else issue_or_month_flag
48
48
 
49
49
  if options.get("early_access", False):
50
- base_path = f"{output_basename}/{pub_type.title()}_Early_Access/{yy}_{im}"
50
+ base_path = os.path.join(output_basename, f"{pub_type.title()}_Early_Access", f"{yy}_{im}")
51
51
  path_output = os.path.join(path_output + "_Early_Access", f"{yy}_{im}")
52
52
  else:
53
- base_path = f"{output_basename}/{pub_type.title()}/{yy}_{im}"
53
+ base_path = os.path.join(output_basename, f"{pub_type.title()}", f"{yy}_{im}")
54
54
  path_output = os.path.join(path_output, f"{yy}_{im}")
55
55
 
56
56
  path_root = base_path if absolute_or_relative_path == "absolute_path" else ""
@@ -106,7 +106,7 @@ def generate_from_bibs_and_write(
106
106
  new_options = publisher_abbr_dict[publisher][abbr]
107
107
 
108
108
  # Get bibliography path
109
- path_abbr = os.path.join(path_storage, f"{publisher.lower()}/{abbr}")
109
+ path_abbr = os.path.join(path_storage, publisher.lower(), abbr)
110
110
  if isinstance(year_flag, str) and year_flag.isdigit():
111
111
  for root, _, files in os.walk(path_abbr, topdown=True):
112
112
  files = [f for f in files if f.endswith(".bib")]
@@ -134,15 +134,17 @@ def generate_from_bibs_and_write(
134
134
  for publisher in publisher_abbr_dict:
135
135
  print(f"*** Combining papers for {publisher.upper()} ***")
136
136
  pp = os.path.join(path_output, publisher.lower())
137
- absolute_path = f"{path_root}/{publisher}" if len(path_root) > 0 else ""
137
+ absolute_path = os.path.join(path_root, publisher) if len(path_root) > 0 else ""
138
138
 
139
139
  link = [f"# {publisher.upper()}\n\n"]
140
140
  for abbr in publisher_abbr_dict[publisher]:
141
141
  if os.path.exists(os.path.join(pp, abbr, f"{abbr}.html")):
142
- link.append(f"- [{abbr}]({absolute_path}/{abbr}/{abbr}.html)\n")
142
+ ll = os.path.join(absolute_path, abbr, f"{abbr}.html")
143
+ link.append(f"- [{abbr}]({ll})\n")
143
144
 
144
145
  if combine_flag:
145
- link.insert(1, f"- [All Journals]({absolute_path}/{publisher}_all.html)\n")
146
+ ll = os.path.join(absolute_path, f"{publisher}_all.html")
147
+ link.insert(1, f"- [All Journals]({ll})\n")
146
148
 
147
149
  # Process combined content
148
150
  if len(link) > 1:
@@ -3,7 +3,7 @@
3
3
  import json
4
4
  import os
5
5
  from datetime import datetime
6
- from typing import Dict, List, Optional
6
+ from typing import Dict, List
7
7
 
8
8
  from pyadvtools import standard_path
9
9
 
@@ -15,7 +15,7 @@ class PaperLinksGenerator:
15
15
  self,
16
16
  json_base_path: str,
17
17
  data_base_path: str,
18
- default_publication_keywords: Optional[List[str]] = None,
18
+ keywords_category_name: str = "",
19
19
  display_year_period: int = 10,
20
20
  ):
21
21
  """
@@ -28,18 +28,21 @@ class PaperLinksGenerator:
28
28
  self.json_base_path = standard_path(json_base_path)
29
29
  self.data_base_path = standard_path(data_base_path)
30
30
 
31
- if (default_publication_keywords is None) or (len(default_publication_keywords) == 0):
32
- x = self._load_json_data("keywords").get("default_keywords", [])
33
- if isinstance(x, list):
34
- default_publication_keywords = x
35
- else:
36
- default_publication_keywords = []
31
+ # Process keyword category name and load data
32
+ keywords_category_name = keywords_category_name.lower().strip() if keywords_category_name else ""
33
+ category_prefix = f"{keywords_category_name}_" if keywords_category_name else ""
34
+ keywords_list = self._load_json_data("keywords").get(f"{category_prefix}keywords", [])
35
+
36
+ # Validate data availability
37
+ if not keywords_list or not keywords_category_name:
38
+ keywords_list, keywords_category_name = [], ""
37
39
 
38
- self.default_publication_keywords: List[str] = default_publication_keywords
40
+ self.keywords_category_name = keywords_category_name
41
+ self.keywords_list: List[str] = keywords_list
39
42
 
40
43
  self.display_year_period = display_year_period
41
44
 
42
- def generate_yearly_links(self, cj: str, folder_name="data/Yearly") -> None:
45
+ def generate_yearly_links(self, cj: str, folder_name=os.path.join("data", "Yearly")) -> None:
43
46
  """
44
47
  Generate yearly markdown table with paper links.
45
48
 
@@ -51,7 +54,7 @@ class PaperLinksGenerator:
51
54
 
52
55
  self._generate_links(cj, flags, folder_flags, folder_name)
53
56
 
54
- def generate_weekly_links(self, folder_name="data/Weekly") -> None:
57
+ def generate_weekly_links(self, folder_name=os.path.join("data", "Weekly")) -> None:
55
58
  """Generate weekly markdown table with journal paper links."""
56
59
  cj = "Journals"
57
60
 
@@ -94,7 +97,7 @@ class PaperLinksGenerator:
94
97
  except Exception as e:
95
98
  print(f"Pandoc conversion error: {e}")
96
99
 
97
- def generate_ieee_early_access_links(self, folder_name="data/Weekly") -> None:
100
+ def generate_ieee_early_access_links(self, folder_name=os.path.join("data", "Weekly")) -> None:
98
101
  """Generate markdown for IEEE Early Access papers."""
99
102
  md_content = [
100
103
  "# Papers from Early Access\n\n",
@@ -171,7 +174,7 @@ class PaperLinksGenerator:
171
174
  cells = []
172
175
 
173
176
  for flag in folder_flags:
174
- link_path = f"{period}/{cj}/{flag}/{publisher.lower()}/{publisher.lower()}_link.html"
177
+ link_path = os.path.join(period, cj, flag, publisher.lower(), f"{publisher.lower()}_link.html")
175
178
  full_path = os.path.join(self.data_base_path, link_path)
176
179
 
177
180
  if os.path.exists(full_path):
@@ -205,7 +208,7 @@ class PaperLinksGenerator:
205
208
  """Get link cells for a abbr."""
206
209
  cells = []
207
210
  for flag in folder_flags:
208
- link_path = f"{period}/{cj}/{flag}/{publisher.lower()}/{abbr}/{abbr}.html"
211
+ link_path = os.path.join(period, cj, flag, publisher.lower(), abbr, f"{abbr}.html")
209
212
  full_path = os.path.join(self.data_base_path, link_path)
210
213
  if os.path.exists(full_path):
211
214
  cells.append(f"[{abbr}]({link_path})")
@@ -214,12 +217,12 @@ class PaperLinksGenerator:
214
217
 
215
218
  return cells
216
219
 
217
- def _get_ieee_links(self, folder_name="data/Weekly") -> List[str]:
220
+ def _get_ieee_links(self, folder_name=os.path.join("data", "Weekly")) -> List[str]:
218
221
  """Get IEEE Early Access links."""
219
222
  links = []
220
223
  link_paths = [
221
- f"{folder_name}/Journals_Early_Access/current_year_current_month/ieee/ieee_link.html",
222
- f"{folder_name}/Journals_Early_Access/all_years_all_months/ieee/ieee_link.html",
224
+ os.path.join(folder_name, "Journals_Early_Access", "current_year_current_month", "ieee", "ieee_link.html"),
225
+ os.path.join(folder_name, "Journals_Early_Access", "all_years_all_months", "ieee", "ieee_link.html"),
223
226
  ]
224
227
 
225
228
  for link_path in link_paths:
@@ -247,13 +250,13 @@ class PaperLinksGenerator:
247
250
  return None
248
251
 
249
252
  #
250
- def generate_keywords_links_monthly(self, cj: str, folder_name="data/Weekly"):
253
+ def generate_keywords_links_monthly(self, cj: str, folder_name=os.path.join("data", "Weekly")):
251
254
  flags = ["Current Issue", "Current Month", "All Months"]
252
255
  folder_flags = [f"current_year_{f.replace(' ', '_').lower()}" for f in flags]
253
256
 
254
257
  self._generate_keywords_links(cj, folder_name, flags, folder_flags)
255
258
 
256
- def generate_keywords_links_yearly(self, cj: str, folder_name="data/Yearly"):
259
+ def generate_keywords_links_yearly(self, cj: str, folder_name=os.path.join("data", "Yearly")):
257
260
  flags = self._get_yearly_flags(cj)
258
261
  folder_flags = [f"{f}_all_months" for f in flags]
259
262
 
@@ -266,16 +269,9 @@ class PaperLinksGenerator:
266
269
 
267
270
  keyword_publisher_abbr = self._process_keywords(cj, json_data)
268
271
 
269
- # Get and sort publication types
270
- pub_types = list(keyword_publisher_abbr.keys())
271
- default_pub_types = self.default_publication_keywords
272
- default_pub_types = self.default_publication_keywords + sorted(
273
- list(set(pub_types) - set(self.default_publication_keywords))
274
- )
275
-
276
272
  all_data_list = ["# Keywords\n\n", "| |Keywords|Links|\n", "|-|-|-|\n"]
277
273
  idx = 1
278
- for keyword in sorted(pub_types, key=default_pub_types.index):
274
+ for keyword in self._default_or_customized_keywords(keyword_publisher_abbr):
279
275
  data_list = [
280
276
  f"# {keyword.title()}\n\n",
281
277
  "|Publishers|Abbreviations|" + "|".join(flags) + "|\n",
@@ -285,7 +281,7 @@ class PaperLinksGenerator:
285
281
  for publisher in keyword_publisher_abbr[keyword]:
286
282
  for abbr in keyword_publisher_abbr[keyword][publisher]:
287
283
  lines = [
288
- f"[Link]({folder_name}/{cj.title()}/{ff}/{publisher.lower()}/{abbr}/{abbr}.html)"
284
+ f"[Link]({os.path.join(folder_name, cj.title(), ff, publisher.lower(), abbr, f'{abbr}.html')})"
289
285
  for ff in folder_flags
290
286
  ]
291
287
 
@@ -295,29 +291,46 @@ class PaperLinksGenerator:
295
291
  if len(data_list) == 3:
296
292
  continue
297
293
 
298
- self._write_md_file(data_list, f"{folder_name}/{cj.title()}_Keywords", f"{keyword.replace(' ', '_')}.md")
294
+ self._write_md_file(
295
+ data_list, os.path.join(folder_name, f"{cj.title()}_Keywords"), f"{keyword.replace(' ', '_')}.md"
296
+ )
299
297
 
300
298
  # Pandoc
301
299
  self._convert_md_to_html_keyword(folder_name, cj, keyword)
302
300
 
303
- all_data_list.append(
304
- f"|{idx}|{keyword}|[Link]({folder_name}/{cj.title()}_Keywords/{keyword.replace(' ', '_')}.html)|\n"
305
- )
301
+ # TODO
302
+ ll = os.path.join(folder_name, f"{cj.title()}_Keywords", f"{keyword.replace(' ', '_')}.html")
303
+ all_data_list.append(f"|{idx}|{keyword}|[Link]({ll})|\n")
306
304
 
307
305
  idx += 1
308
306
 
309
- self._write_md_file(all_data_list, f"{folder_name}", f"{cj.title()}_Keywords.md")
307
+ category_postfix = f"_{self.keywords_category_name.title()}" if self.keywords_category_name else ""
308
+ self._write_md_file(all_data_list, f"{folder_name}", f"{cj.title()}_Keywords{category_postfix}.md")
309
+
310
+ def _default_or_customized_keywords(self, json_data):
311
+ keywords = list(json_data.keys())
312
+
313
+ # Get and sort publication types
314
+ if self.keywords_category_name and self.keywords_list:
315
+ _keywords = []
316
+ for keyword in self.keywords_list:
317
+ if keyword in keywords:
318
+ _keywords.append(keyword)
319
+ return _keywords
320
+ else:
321
+ # default
322
+ return sorted(keywords)
310
323
 
311
324
  def _check_file_exists(self, folder, folder_name, cj, publisher, abbr):
312
325
  """Check if HTML file exists for given parameters."""
313
326
  file_path = os.path.join(
314
- self.data_base_path, f"{folder_name}/{cj.title()}/{folder}/{publisher.lower()}/{abbr}/{abbr}.html"
327
+ self.data_base_path, folder_name, cj.title(), folder, publisher.lower(), abbr, f"{abbr}.html"
315
328
  )
316
329
  return os.path.exists(file_path)
317
330
 
318
331
  def _convert_md_to_html_keyword(self, folder_name, cj, keyword):
319
332
  """Convert markdown file to HTML using pandoc."""
320
- base_path = os.path.join(self.data_base_path, f"{folder_name}/{cj.title()}_Keywords")
333
+ base_path = os.path.join(self.data_base_path, folder_name, f"{cj.title()}_Keywords")
321
334
  file_md = os.path.join(base_path, f"{keyword.replace(' ', '_')}.md")
322
335
  file_html = os.path.join(base_path, f"{keyword.replace(' ', '_')}.html")
323
336
 
@@ -30,7 +30,8 @@ class ProcessSpiderUrl(object):
30
30
  ) -> None:
31
31
  if os.path.exists(self.path_abbr):
32
32
  for i in [f for f in os.listdir(self.path_abbr) if f.startswith(folder_start_swith)]:
33
- print("*" * 5 + f" Check *{extension} ./{os.path.basename(self.path_abbr)}/{i}")
33
+ ll = os.path.join(os.path.basename(self.path_abbr), i)
34
+ print("*" * 5 + f" Check *{extension} .{os.sep}{ll}")
34
35
  self._check_delete(os.path.join(self.path_abbr, i), extension, write_flag, iterate_check_url)
35
36
 
36
37
  def _check_delete(
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "pyeasyphd"
3
- version = "0.0.7"
3
+ version = "0.0.9"
4
4
  description = "pyeasyphd"
5
5
  license = "GPL-3.0-or-later"
6
6
  authors = ["NextAI <nextartifintell@gmail.com>"]
File without changes