pyeasyphd 0.0.8__py3-none-any.whl → 0.1.0__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.
- pyeasyphd/tools/compare/compare_bibs.py +1 -1
- pyeasyphd/tools/generate/generate_from_bibs.py +8 -6
- pyeasyphd/tools/generate/generate_links.py +47 -36
- pyeasyphd/tools/spider/process_spider_url.py +2 -1
- {pyeasyphd-0.0.8.dist-info → pyeasyphd-0.1.0.dist-info}/METADATA +3 -2
- {pyeasyphd-0.0.8.dist-info → pyeasyphd-0.1.0.dist-info}/RECORD +7 -7
- {pyeasyphd-0.0.8.dist-info → pyeasyphd-0.1.0.dist-info}/WHEEL +1 -1
|
@@ -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 {'
|
|
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"{
|
|
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"{
|
|
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,
|
|
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 =
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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.
|
|
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
|
|
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
|
|
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
|
|
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 =
|
|
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 =
|
|
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
|
|
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
|
-
|
|
222
|
-
|
|
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
|
|
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
|
|
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
|
|
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(
|
|
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
|
-
|
|
304
|
-
|
|
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
|
-
|
|
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,
|
|
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"{
|
|
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
|
-
|
|
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
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: pyeasyphd
|
|
3
|
-
Version: 0.0
|
|
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
|
|
@@ -58,11 +58,11 @@ pyeasyphd/pyeasyphd.py,sha256=vPM4uPmr6jSxVOy0zYetoijc8wUkQdXExUVdJyWynVQ,2875
|
|
|
58
58
|
pyeasyphd/pyeasyphd.sublime-settings,sha256=6D5SYWsG6xn8OEu6IchIDGGGH7uLX4v451X28yeAevU,8718
|
|
59
59
|
pyeasyphd/pyeasyphd.sublime-syntax,sha256=pXylbA-tye-K5dCTjEJLFVRqtY1T7AgWZ4laxo-dnaE,73
|
|
60
60
|
pyeasyphd/tools/__init__.py,sha256=4l2e19MWmVrAvIH3IOA7v1EPaaBBvuq1UbXhmd6_bts,1041
|
|
61
|
-
pyeasyphd/tools/compare/compare_bibs.py,sha256=
|
|
61
|
+
pyeasyphd/tools/compare/compare_bibs.py,sha256=9Pd3ZuLNgP4yVM4_7O9WMVg6e7VuHnMKXxgv8tHTjsI,10167
|
|
62
62
|
pyeasyphd/tools/experiments_base.py,sha256=mx-vt0dpgjhsYcRyVpQkzdbJw_CFXcaaYt81w13y4Tc,7639
|
|
63
63
|
pyeasyphd/tools/format_save_bibs.py,sha256=mRwrilzC4coul-Bf8aZwrCOCZB9ah_G-Zy9DcGAr_4Q,7073
|
|
64
|
-
pyeasyphd/tools/generate/generate_from_bibs.py,sha256=
|
|
65
|
-
pyeasyphd/tools/generate/generate_links.py,sha256=
|
|
64
|
+
pyeasyphd/tools/generate/generate_from_bibs.py,sha256=5rdIvcU62MDmyND6HIwrnm2zC6hhLQOwPetVn1EnGRI,17917
|
|
65
|
+
pyeasyphd/tools/generate/generate_links.py,sha256=2U6sA8YfNz5cNPA1TEGM6oe3yny0crrnspbeHudiAPs,14384
|
|
66
66
|
pyeasyphd/tools/py_run_bib_md_tex.py,sha256=lc6JqfXeJSMA8icTJTC7X1pq4tgurOaXq9f0-LSJK7g,14657
|
|
67
67
|
pyeasyphd/tools/replace/replace.py,sha256=wXdO72PpqZ-Iyzq5AjVCIpx8h2d1YCTiWY9VSbQAVvs,3337
|
|
68
68
|
pyeasyphd/tools/search/data.py,sha256=7uHXfHTcn88zkfqAGZMNcSd2OjS2LhkpE9paNuSUUqw,10754
|
|
@@ -72,9 +72,9 @@ pyeasyphd/tools/search/search_keywords.py,sha256=O_ivQzElsjujTHqU0Sxw4w4v3VwcN56
|
|
|
72
72
|
pyeasyphd/tools/search/search_writers.py,sha256=qP6UE_oK2LKriP7kfoDR4j8p7MlV09zdK7LnXHHB1_8,12564
|
|
73
73
|
pyeasyphd/tools/search/utils.py,sha256=yLKrMmM2x-fHdm6P8haFZzagd9sLkViTdwJTHyGRgXY,6092
|
|
74
74
|
pyeasyphd/tools/spider/process_spider_bib.py,sha256=p1UNUaLAxMZPYtuwjNi20e1ms--cyjlB7CIZFP3SX6U,10443
|
|
75
|
-
pyeasyphd/tools/spider/process_spider_url.py,sha256=
|
|
75
|
+
pyeasyphd/tools/spider/process_spider_url.py,sha256=XkMk6nqgYdc1WhWU03hWjBXnewxiCG21BF-I2qcFMn8,3014
|
|
76
76
|
pyeasyphd/tools/spider/process_spider_url_bib.py,sha256=1b0FnUlTt5BzaOqFZJmnY5gnAhdD4pbQolHR1e3wiyE,2705
|
|
77
77
|
pyeasyphd/utils/utils.py,sha256=yuHy6D2mTsd2aAwNBSMC7CU4LV-MkWwzKeO_0Iehbyg,1655
|
|
78
|
-
pyeasyphd-0.0.
|
|
79
|
-
pyeasyphd-0.0.
|
|
80
|
-
pyeasyphd-0.0.
|
|
78
|
+
pyeasyphd-0.1.0.dist-info/METADATA,sha256=MIlOnQKvqdWCh1jJ2HrJkxKx3Cl-toHtj0ermogvsUY,1094
|
|
79
|
+
pyeasyphd-0.1.0.dist-info/WHEEL,sha256=M5asmiAlL6HEcOq52Yi5mmk9KmTVjY2RDPtO4p9DMrc,88
|
|
80
|
+
pyeasyphd-0.1.0.dist-info/RECORD,,
|