pyeasyphd 0.0.8__tar.gz → 0.1.0__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.8 → pyeasyphd-0.1.0}/PKG-INFO +3 -2
  2. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/tools/compare/compare_bibs.py +1 -1
  3. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/tools/generate/generate_from_bibs.py +8 -6
  4. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/tools/generate/generate_links.py +47 -36
  5. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/tools/spider/process_spider_url.py +2 -1
  6. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyproject.toml +1 -1
  7. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/README.md +0 -0
  8. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/.python-version +0 -0
  9. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/Main.sublime-menu +0 -0
  10. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/__init__.py +0 -0
  11. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/__init__.py +0 -0
  12. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexbase/__init__.py +0 -0
  13. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexbase/standardize/_base.py +0 -0
  14. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexbase/standardize/default_data.py +0 -0
  15. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexbase/standardize/do_on_bib.py +0 -0
  16. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexbase/standardize/do_on_comment_block.py +0 -0
  17. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexbase/standardize/do_on_entry_block.py +0 -0
  18. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexbase/standardize/do_on_preamble_block.py +0 -0
  19. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexbase/standardize/do_on_string_block.py +0 -0
  20. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexbase/standardize_bib.py +0 -0
  21. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/__init__.py +0 -0
  22. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/bibtex_format.py +0 -0
  23. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/exceptions.py +0 -0
  24. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/library.py +0 -0
  25. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/middlewares/block/add.py +0 -0
  26. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/middlewares/block/authors.py +0 -0
  27. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/middlewares/block/doi_url.py +0 -0
  28. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/middlewares/block/entry_field_keys_normalize.py +0 -0
  29. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/middlewares/block/entry_field_keys_replace.py +0 -0
  30. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/middlewares/block/entry_field_values_normalize.py +0 -0
  31. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/middlewares/block/entry_fields_delete.py +0 -0
  32. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/middlewares/block/entry_fields_keep.py +0 -0
  33. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/middlewares/block/entry_fields_sort.py +0 -0
  34. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/middlewares/block/entry_types.py +0 -0
  35. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/middlewares/block/journal_booktitle.py +0 -0
  36. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/middlewares/block/month_year.py +0 -0
  37. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/middlewares/block/number_volume.py +0 -0
  38. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/middlewares/block/pages.py +0 -0
  39. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/middlewares/block/title.py +0 -0
  40. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/middlewares/library/generating_entrykeys.py +0 -0
  41. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/middlewares/library/keeping_blocks.py +0 -0
  42. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/middlewares/library/sorting_blocks.py +0 -0
  43. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/middlewares/middleware.py +0 -0
  44. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/middlewares/parsestack.py +0 -0
  45. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/middlewares/utils.py +0 -0
  46. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/middlewares_library_to_library.py +0 -0
  47. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/middlewares_library_to_str.py +0 -0
  48. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/middlewares_str_to_library.py +0 -0
  49. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/middlewares_str_to_str.py +0 -0
  50. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/model.py +0 -0
  51. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/bibtexparser/splitter.py +0 -0
  52. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/core/__init__.py +0 -0
  53. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/core/convert_library_to_library.py +0 -0
  54. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/core/convert_library_to_str.py +0 -0
  55. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/core/convert_str_to_library.py +0 -0
  56. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/bib/core/convert_str_to_str.py +0 -0
  57. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/main/__init__.py +0 -0
  58. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/main/basic_input.py +0 -0
  59. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/main/pandoc_md_to.py +0 -0
  60. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/main/python_run_bib.py +0 -0
  61. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/main/python_run_md.py +0 -0
  62. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/main/python_run_tex.py +0 -0
  63. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/main/python_writers.py +0 -0
  64. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/pyeasyphd.py +0 -0
  65. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/pyeasyphd.sublime-settings +0 -0
  66. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/pyeasyphd.sublime-syntax +0 -0
  67. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/tools/__init__.py +0 -0
  68. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/tools/experiments_base.py +0 -0
  69. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/tools/format_save_bibs.py +0 -0
  70. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/tools/py_run_bib_md_tex.py +0 -0
  71. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/tools/replace/replace.py +0 -0
  72. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/tools/search/data.py +0 -0
  73. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/tools/search/search_base.py +0 -0
  74. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/tools/search/search_core.py +0 -0
  75. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/tools/search/search_keywords.py +0 -0
  76. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/tools/search/search_writers.py +0 -0
  77. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/tools/search/utils.py +0 -0
  78. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/tools/spider/process_spider_bib.py +0 -0
  79. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/pyeasyphd/tools/spider/process_spider_url_bib.py +0 -0
  80. {pyeasyphd-0.0.8 → pyeasyphd-0.1.0}/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.8
3
+ Version: 0.1.0
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
@@ -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:
@@ -246,14 +249,13 @@ class PaperLinksGenerator:
246
249
 
247
250
  return None
248
251
 
249
- #
250
- def generate_keywords_links_monthly(self, cj: str, folder_name="data/Weekly"):
252
+ def generate_keywords_links_monthly(self, cj: str, folder_name=os.path.join("data", "Weekly")):
251
253
  flags = ["Current Issue", "Current Month", "All Months"]
252
254
  folder_flags = [f"current_year_{f.replace(' ', '_').lower()}" for f in flags]
253
255
 
254
256
  self._generate_keywords_links(cj, folder_name, flags, folder_flags)
255
257
 
256
- def generate_keywords_links_yearly(self, cj: str, folder_name="data/Yearly"):
258
+ def generate_keywords_links_yearly(self, cj: str, folder_name=os.path.join("data", "Yearly")):
257
259
  flags = self._get_yearly_flags(cj)
258
260
  folder_flags = [f"{f}_all_months" for f in flags]
259
261
 
@@ -266,16 +268,9 @@ class PaperLinksGenerator:
266
268
 
267
269
  keyword_publisher_abbr = self._process_keywords(cj, json_data)
268
270
 
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
271
  all_data_list = ["# Keywords\n\n", "| |Keywords|Links|\n", "|-|-|-|\n"]
277
272
  idx = 1
278
- for keyword in sorted(pub_types, key=default_pub_types.index):
273
+ for keyword in self._default_or_customized_keywords(keyword_publisher_abbr):
279
274
  data_list = [
280
275
  f"# {keyword.title()}\n\n",
281
276
  "|Publishers|Abbreviations|" + "|".join(flags) + "|\n",
@@ -285,7 +280,7 @@ class PaperLinksGenerator:
285
280
  for publisher in keyword_publisher_abbr[keyword]:
286
281
  for abbr in keyword_publisher_abbr[keyword][publisher]:
287
282
  lines = [
288
- f"[Link]({folder_name}/{cj.title()}/{ff}/{publisher.lower()}/{abbr}/{abbr}.html)"
283
+ f"[Link]({os.path.join(folder_name, cj.title(), ff, publisher.lower(), abbr, f'{abbr}.html')})"
289
284
  for ff in folder_flags
290
285
  ]
291
286
 
@@ -295,29 +290,45 @@ class PaperLinksGenerator:
295
290
  if len(data_list) == 3:
296
291
  continue
297
292
 
298
- self._write_md_file(data_list, f"{folder_name}/{cj.title()}_Keywords", f"{keyword.replace(' ', '_')}.md")
293
+ self._write_md_file(
294
+ data_list, os.path.join(folder_name, f"{cj.title()}_Keywords"), f"{keyword.replace(' ', '_')}.md"
295
+ )
299
296
 
300
297
  # Pandoc
301
298
  self._convert_md_to_html_keyword(folder_name, cj, keyword)
302
299
 
303
- all_data_list.append(
304
- f"|{idx}|{keyword}|[Link]({folder_name}/{cj.title()}_Keywords/{keyword.replace(' ', '_')}.html)|\n"
305
- )
300
+ ll = os.path.join(folder_name, f"{cj.title()}_Keywords", f"{keyword.replace(' ', '_')}.html")
301
+ all_data_list.append(f"|{idx}|{keyword}|[Link]({ll})|\n")
306
302
 
307
303
  idx += 1
308
304
 
309
- self._write_md_file(all_data_list, f"{folder_name}", f"{cj.title()}_Keywords.md")
305
+ category_postfix = f"_{self.keywords_category_name.title()}" if self.keywords_category_name else ""
306
+ self._write_md_file(all_data_list, f"{folder_name}", f"{cj.title()}_Keywords{category_postfix}.md")
307
+
308
+ def _default_or_customized_keywords(self, json_data):
309
+ keywords = list(json_data.keys())
310
+
311
+ # Get and sort publication types
312
+ if self.keywords_category_name and self.keywords_list:
313
+ _keywords = []
314
+ for keyword in self.keywords_list:
315
+ if keyword in keywords:
316
+ _keywords.append(keyword)
317
+ return _keywords
318
+ else:
319
+ # default
320
+ return sorted(keywords)
310
321
 
311
322
  def _check_file_exists(self, folder, folder_name, cj, publisher, abbr):
312
323
  """Check if HTML file exists for given parameters."""
313
324
  file_path = os.path.join(
314
- self.data_base_path, f"{folder_name}/{cj.title()}/{folder}/{publisher.lower()}/{abbr}/{abbr}.html"
325
+ self.data_base_path, folder_name, cj.title(), folder, publisher.lower(), abbr, f"{abbr}.html"
315
326
  )
316
327
  return os.path.exists(file_path)
317
328
 
318
329
  def _convert_md_to_html_keyword(self, folder_name, cj, keyword):
319
330
  """Convert markdown file to HTML using pandoc."""
320
- base_path = os.path.join(self.data_base_path, f"{folder_name}/{cj.title()}_Keywords")
331
+ base_path = os.path.join(self.data_base_path, folder_name, f"{cj.title()}_Keywords")
321
332
  file_md = os.path.join(base_path, f"{keyword.replace(' ', '_')}.md")
322
333
  file_html = os.path.join(base_path, f"{keyword.replace(' ', '_')}.html")
323
334
 
@@ -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.8"
3
+ version = "0.1.0"
4
4
  description = "pyeasyphd"
5
5
  license = "GPL-3.0-or-later"
6
6
  authors = ["NextAI <nextartifintell@gmail.com>"]
File without changes