pyeasyphd 0.3.4__py3-none-any.whl → 0.3.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.

@@ -2,11 +2,12 @@ __all__ = [
2
2
  "run_article_md_daily_notes",
3
3
  "run_article_tex_submit",
4
4
  "run_beamer_tex_weekly_reports",
5
- "run_search_for_files",
6
5
  "run_search_for_screen",
6
+ "run_search_for_files",
7
+ "run_compare_after_search",
7
8
  ]
8
9
 
9
10
  from .run_article_md import run_article_md_daily_notes
10
11
  from .run_article_tex import run_article_tex_submit
11
12
  from .run_beamer_tex import run_beamer_tex_weekly_reports
12
- from .run_search_keywords import run_search_for_files, run_search_for_screen
13
+ from .run_search_keywords import run_compare_after_search, run_search_for_files, run_search_for_screen
@@ -1,6 +1,9 @@
1
1
  import os
2
2
  from typing import Any, Dict, List
3
3
 
4
+ from pyadvtools import transform_to_data_list
5
+ from pybibtexer.tools import compare_bibs_with_zotero
6
+
4
7
  from pyeasyphd.tools import Searchkeywords
5
8
 
6
9
 
@@ -157,3 +160,103 @@ def _execute_searches(
157
160
  path_storage = os.path.join(path_spidering_bibs, je)
158
161
  path_output = os.path.join(path_main_output, "Search_spidering_bib", je)
159
162
  Searchkeywords(path_storage, path_output, options).run()
163
+
164
+
165
+ def run_compare_after_search(
166
+ zotero_bib: str,
167
+ keywords_type: str,
168
+ path_main_output: str,
169
+ path_conferences_journals_json: str,
170
+ ):
171
+ """
172
+ Compare search results with Zotero bibliography and generate comparison report.
173
+
174
+ Args:
175
+ zotero_bib: Path to Zotero bibliography file
176
+ keywords_type: Category name for the search keywords used
177
+ path_main_output: Main output directory for search results and comparison
178
+ path_conferences_journals_json: Path to conferences/journals JSON files
179
+ """
180
+ # Expand and normalize file paths
181
+ zotero_bib = _expand_path(zotero_bib)
182
+ path_main_output = _expand_path(path_main_output)
183
+ path_conferences_journals_json = _expand_path(path_conferences_journals_json)
184
+
185
+ # Configure search options
186
+ options = _build_search_options(
187
+ print_on_screen=False,
188
+ search_year_list=[],
189
+ include_publisher_list=[],
190
+ include_abbr_list=[],
191
+ exclude_publisher_list=["arXiv"],
192
+ exclude_abbr_list=[],
193
+ keywords_type=keywords_type,
194
+ keywords_list_list=[],
195
+ path_conferences_journals_json=path_conferences_journals_json,
196
+ )
197
+
198
+ # Download bibliography files from local search results
199
+ download_bib = _download_bib_from_local(path_main_output, keywords_type)
200
+
201
+ # Generate comparison output path and run comparison
202
+ path_output = os.path.join(path_main_output, "comparison_new")
203
+ compare_bibs_with_zotero(zotero_bib, download_bib, path_output, options)
204
+
205
+ return None
206
+
207
+
208
+ def _generate_data_list(path_output: str, folder_name: str, keywords_type: str) -> list[str]:
209
+ """
210
+ Extract bibliography data content from files in specified folder structure.
211
+
212
+ Args:
213
+ path_output: Base output path for search results
214
+ folder_name: Specific folder name within the output structure
215
+ keywords_type: Category name for the search keywords used
216
+
217
+ Returns:
218
+ List of bibliography data content extracted from .bib files in the specified folders
219
+ """
220
+ data_list = []
221
+
222
+ # Extract data from both title and abstract bibliography folders
223
+ for bib_type in ["title-bib-zotero", "abstract-bib-zotero"]:
224
+ folder_path = os.path.join(
225
+ path_output,
226
+ f"{folder_name}-Separate",
227
+ "article",
228
+ keywords_type,
229
+ bib_type
230
+ )
231
+
232
+ # Extract bibliography data content if folder exists
233
+ if os.path.exists(folder_path):
234
+ data_list.extend(transform_to_data_list(folder_path, ".bib"))
235
+
236
+ return data_list
237
+
238
+
239
+ def _download_bib_from_local(path_output: str, keywords_type: str) -> list[str]:
240
+ """
241
+ Collect bibliography data content from all local search result directories.
242
+
243
+ Args:
244
+ path_output: Base output path containing search results
245
+ keywords_type: Category name for the search keywords used
246
+
247
+ Returns:
248
+ Combined list of bibliography data content from all .bib files in search results
249
+ """
250
+ data_list = []
251
+
252
+ # Collect data from spidered bibliographies (Conferences and Journals)
253
+ for cj in ["Conferences", "Journals"]:
254
+ folder_name = os.path.join("Search_spidered_bib", cj)
255
+ data_list.extend(_generate_data_list(path_output, folder_name, keywords_type))
256
+
257
+ # Collect data from spidering bibliographies (journal sources)
258
+ for je in ["spider_j", "spider_j_e"]:
259
+ folder_name = os.path.join("Search_spidering_bib", je)
260
+ data_list.extend(_generate_data_list(path_output, folder_name, keywords_type))
261
+
262
+ return data_list
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyeasyphd
3
- Version: 0.3.4
3
+ Version: 0.3.5
4
4
  Summary: pyeasyphd
5
5
  License: GPL-3.0-or-later
6
6
  License-File: LICENSE
@@ -26,11 +26,11 @@ pyeasyphd/main/python_run_tex.py,sha256=9Syu8qRjPXN3gEabfRUWxwTFBm_izIcB4yFhsz3Q
26
26
  pyeasyphd/pyeasyphd.py,sha256=OAwbwq2rSXLSk2AoTAF8hmlOMRSRfvDn1Uqk-zkuqH8,3470
27
27
  pyeasyphd/pyeasyphd.sublime-settings,sha256=KcXx3DjyVf8UfnB4FP4u-jaTQU3Cuj24OvxGCZvXAsw,3135
28
28
  pyeasyphd/pyeasyphd.sublime-syntax,sha256=pXylbA-tye-K5dCTjEJLFVRqtY1T7AgWZ4laxo-dnaE,73
29
- pyeasyphd/scripts/__init__.py,sha256=R-gQqvYxkiQFZXjzxIWSNheWRolklXb1QY8b2nrKKZk,415
29
+ pyeasyphd/scripts/__init__.py,sha256=0UW0H3Ht37dI1Kn3Pfdov3T7BvRLYDtRS40euB_t4Ls,473
30
30
  pyeasyphd/scripts/run_article_md.py,sha256=ZjdO03YRDokSqo-Rffby-1p6_P35N4amERKHe4yS6_0,4127
31
31
  pyeasyphd/scripts/run_article_tex.py,sha256=TuTEQk7y-Ykos3a_mlEJzyFnT9RKsAYjGXnwHJa5cjY,4672
32
32
  pyeasyphd/scripts/run_beamer_tex.py,sha256=UUOadRfmyWGfK__9NzJIUo1lAiDRB5edxRsfhrS3Ejo,4209
33
- pyeasyphd/scripts/run_search_keywords.py,sha256=HAbELDQy2buf2pxZvmdAM6GrS8W9dGSsuf8cOB5GyFA,6178
33
+ pyeasyphd/scripts/run_search_keywords.py,sha256=jvBgYYNvOmiQYXCBPEP6dPo0SxvFRHQE2sPIOVvEmHc,9831
34
34
  pyeasyphd/tools/__init__.py,sha256=u1MZu_JjVac3HhEmcSTwroS83UVu0W5Vspy3Wu_-GH8,496
35
35
  pyeasyphd/tools/generate/generate_from_bibs.py,sha256=Dp1MyADwIRb9qFTFOkMPJLaeeh7NBjuiSLBN7smP2eo,7640
36
36
  pyeasyphd/tools/generate/generate_html.py,sha256=JzUEqgTVCaFzd4hXTYUEf0cVSO1QRe0nVUS72W6oyyU,5349
@@ -44,7 +44,7 @@ pyeasyphd/tools/search/search_keywords.py,sha256=YCurXuoYeU1ftve0cb8Hcn_g2FXCXf7
44
44
  pyeasyphd/tools/search/search_writers.py,sha256=Dz6D8m17R7x8NT7_PCjwmzlq29AfUz-N6sjyCguDTo4,15702
45
45
  pyeasyphd/tools/search/utils.py,sha256=bo7xtIZu31dQvjol1lwyWq1t6ldbw28oondwK8VbAqk,7562
46
46
  pyeasyphd/utils/utils.py,sha256=kWxzzgNwz77K9Q7j-RKTaoPpxqiVLVtaBMMhLuEenwE,3128
47
- pyeasyphd-0.3.4.dist-info/METADATA,sha256=yTHmsfDu8UqmssQFuVtZhpMeEc8PI8azisZEwGHoyDU,985
48
- pyeasyphd-0.3.4.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
49
- pyeasyphd-0.3.4.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
50
- pyeasyphd-0.3.4.dist-info/RECORD,,
47
+ pyeasyphd-0.3.5.dist-info/METADATA,sha256=T1k7yh4ZsdlWxiW1XbmPBMQx1VtjfS8gu-Agnl26Y8g,985
48
+ pyeasyphd-0.3.5.dist-info/WHEEL,sha256=zp0Cn7JsFoX2ATtOhtaFYIiE2rmFAD4OcMhtUki8W3U,88
49
+ pyeasyphd-0.3.5.dist-info/licenses/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
50
+ pyeasyphd-0.3.5.dist-info/RECORD,,