pyeasyphd 0.0.2__py3-none-any.whl → 0.0.4__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.

@@ -128,18 +128,18 @@ class BasicInput(object):
128
128
  csl_name = options.get("csl_name", "apa-no-ampersand")
129
129
  if len(csl_name) == 0:
130
130
  csl_name = "apa-no-ampersand"
131
- self.full_csl_style_pandoc = os.path.join(self.path_templates, f"CSL/{csl_name}.csl")
132
- self.full_tex_article_template_pandoc = os.path.join(self.path_templates, "TEX/eisvogel.tex")
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
133
 
134
- self.article_template_tex = read_list(os.path.join(self.path_templates, "TEX/Article.tex"))
134
+ self.article_template_tex = read_list(os.path.join(self.path_templates, "TEX", "Article.tex"))
135
135
 
136
136
  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"))
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"))
143
143
 
144
144
  # handly preamble
145
145
  self.handly_preamble = options.get("handly_preamble", False)
@@ -323,8 +323,8 @@ class PandocMdTo(BasicInput):
323
323
  def generate_tex_content(self, file_prefix: str, path_subsection: str, path_bib: str, path_combine: str) -> None:
324
324
  # for latex
325
325
  # add template for tex file
326
- add_bib_name = "{}/{}-abbr.bib".format(os.path.basename(path_bib), file_prefix)
327
- add_tex_name = "{}/{}.tex".format(os.path.basename(path_subsection), file_prefix)
326
+ add_bib_name = os.path.join(os.path.basename(path_bib), f"{file_prefix}-abbr.bib")
327
+ add_tex_name = os.path.join(os.path.basename(path_subsection), f"{file_prefix}.tex")
328
328
  insert_part_one, insert_part_two = self._generate_tex_content(file_prefix, add_tex_name, add_bib_name)
329
329
 
330
330
  # write tex
@@ -343,9 +343,9 @@ class PandocMdTo(BasicInput):
343
343
  part_one = [
344
344
  "\\date{" + "{}".format(time.strftime("%B %d, %Y")) + "}\n\n",
345
345
  "\\ifx \\fullpath \\undefined\n",
346
- " \\addbibresource{" + "../{}".format(add_bib_name) + "}\n",
346
+ " \\addbibresource{" + os.path.join("..", add_bib_name) + "}\n",
347
347
  "\\else\n",
348
- " \\addbibresource{" + "\\fullpath/{}".format(add_bib_name) + "}\n",
348
+ " \\addbibresource{" + os.path.join("\\fullpath", add_bib_name) + "}\n",
349
349
  "\\fi\n\n",
350
350
  ]
351
351
  part_two = [
@@ -353,9 +353,9 @@ class PandocMdTo(BasicInput):
353
353
  "% \\maketitle\n",
354
354
  "\\tableofcontents\n\n",
355
355
  "\\ifx \\fullpath \\undefined\n",
356
- " \\input{" + "../{}".format(add_tex_name) + "}\n",
356
+ " \\input{" + os.path.join("..", add_tex_name) + "}\n",
357
357
  "\\else\n",
358
- " \\input{" + "\\fullpath/{}".format(add_tex_name) + "}\n",
358
+ " \\input{" + os.path.join("\\fullpath", add_tex_name) + "}\n",
359
359
  "\\fi\n",
360
360
  ]
361
361
  return part_one, part_two
@@ -48,8 +48,8 @@ class PythonRunTex(BasicInput):
48
48
  # for figures
49
49
  for i in range(len(data_list_body)):
50
50
  if re.search(r"\\includegraphics", data_list_body[i]):
51
- data_list_body[i] = data_list_body[i].replace("./Figures/", f"./{figure_folder_name}/")
52
- data_list_body[i] = data_list_body[i].replace("Figures/", f"{figure_folder_name}/")
51
+ data_list_body[i] = data_list_body[i].replace(f".{os.sep}Figures{os.sep}", f".{os.sep}{figure_folder_name}{os.sep}")
52
+ data_list_body[i] = data_list_body[i].replace(f"Figures{os.sep}", f"{figure_folder_name}{os.sep}")
53
53
  write_list(data_list_body, output_tex_name, "w", os.path.join(path_output, tex_folder_name), False)
54
54
 
55
55
  self._special_operate_tex(
@@ -105,15 +105,15 @@ class PythonRunTex(BasicInput):
105
105
  data_list = insert_list_in_list(data_list, ["\n\\def\\cn{}\n"], r"\\documentclass", "after")
106
106
 
107
107
  # for bib
108
- regex = re.compile(r"\\addbibresource{\./References/References\.bib}")
108
+ regex = re.compile(r"\\addbibresource{" + os.path.join(".", "References", "References.bib") + "}")
109
109
  for i in range(len(data_list)):
110
110
  mch = regex.search(data_list[i])
111
111
  if not mch:
112
112
  continue
113
113
  if bib_folder_name:
114
- data_list[i] = "\\addbibresource{" + f"./{bib_folder_name}/{bib_name}" + "}\n"
114
+ data_list[i] = "\\addbibresource{" + os.path.join(".", bib_folder_name, bib_name) + "}\n"
115
115
  else:
116
- data_list[i] = "\\addbibresource{" + f"./{bib_name}" + "}\n"
116
+ data_list[i] = "\\addbibresource{" + os.path.join(".", bib_name) + "}\n"
117
117
 
118
118
  # body
119
119
  if len(data_list_body) != 0:
@@ -1,6 +1,7 @@
1
1
  {
2
2
  // config
3
3
  // config path
4
+ // Must be configured by the user.
4
5
  "path_config": "",
5
6
 
6
7
  // figures, templates, bibs
@@ -8,27 +9,27 @@
8
9
  "path_figures": "",
9
10
  "path_templates": "",
10
11
 
11
- // pypapers/bib/core/convert_str_to_str.py
12
+ // pyeasyphd/bib/core/convert_str_to_str.py
12
13
  "default_additional_field_list": [],
13
14
 
14
- // pypapers/bib/bibtexparser/middlewares_str_to_str.py
15
+ // pyeasyphd/bib/bibtexparser/middlewares_str_to_str.py
15
16
  "substitute_in_bib": true,
16
17
  "substitute_old_list": [],
17
18
  "substitute_new_list": [],
18
19
 
19
20
 
20
- // pypapers/bib/core/convert_str_to_library.py
21
+ // pyeasyphd/bib/core/convert_str_to_library.py
21
22
  "is_standardize_bib": true,
22
23
 
23
- // pypapers/bib/bibtexparser/middlewares_str_to_library.py
24
+ // pyeasyphd/bib/bibtexparser/middlewares_str_to_library.py
24
25
  "is_display_implicit_comments": true,
25
26
 
26
27
 
27
- // pypapers/bib/core/convert_library_to_library.py
28
+ // pyeasyphd/bib/core/convert_library_to_library.py
28
29
  // "abbr", "zotero", or "save"
29
30
  "choose_abbr_zotero_save": "save",
30
31
 
31
- // pypapers/bib/bibtexparser/middlewares_library_to_library.py
32
+ // pyeasyphd/bib/bibtexparser/middlewares_library_to_library.py
32
33
  "function_common_again": true,
33
34
  "function_common_again_abbr": true,
34
35
  "function_common_again_zotero": true,
@@ -134,13 +135,13 @@
134
135
  "delete_fields_list_for_save": [],
135
136
 
136
137
 
137
- // pypapers/bib/core/convert_library_to_str.py
138
+ // pyeasyphd/bib/core/convert_library_to_str.py
138
139
  "is_standardize_library": false,
139
140
  "empty_entry_cite_keys": false,
140
141
  "add_index_to_entries": false,
141
142
  "entries_necessary": true,
142
143
 
143
- // pypapers/bib/bibtexparser/middlewares_library_to_str.py
144
+ // pyeasyphd/bib/bibtexparser/middlewares_library_to_str.py
144
145
  "is_sort_entry_fields": true,
145
146
  "is_sort_blocks": true,
146
147
  "sort_entries_by_cite_keys": [],
@@ -148,7 +149,7 @@
148
149
  "sort_entries_by_field_keys_reverse": true,
149
150
 
150
151
 
151
- // pypapers/main/pandoc_md_to.py
152
+ // pyeasyphd/main/pandoc_md_to.py
152
153
  // for pandoc
153
154
  "csl_name": "apa-no-ampersand",
154
155
  // the number of columns in md files
@@ -160,7 +161,7 @@
160
161
  "cite_flag_in_tex": "cite",
161
162
 
162
163
  // for bib file
163
- // pypapers/main/python_writers.py
164
+ // pyeasyphd/main/python_writers.py
164
165
  // "abbr.bib", "zotero.bib", "save.bib"
165
166
  "bib_for_abbr_name": "abbr.bib",
166
167
  "bib_for_zotero_name": "zotero.bib",
@@ -174,7 +175,7 @@
174
175
  "bibtex_format_block_separator": "",
175
176
 
176
177
  // for md file
177
- // pypapers/main/python_run_md.py
178
+ // pyeasyphd/main/python_run_md.py
178
179
  // default is ""
179
180
  "final_output_main_md_name": "",
180
181
  // true, false
@@ -191,7 +192,7 @@
191
192
  "display_basic_beauty_complex_references_in_md": "beauty",
192
193
 
193
194
  // for tex file
194
- // pypapers/main/python_run_tex.py
195
+ // pyeasyphd/main/python_run_tex.py
195
196
  // handly preamble
196
197
  "handly_preamble": false,
197
198
 
@@ -208,7 +209,7 @@
208
209
  ".nav", ".snm", ".toc", ".xdv"
209
210
  ],
210
211
 
211
- // pypapers/tools/python_run_latex_md.py
212
+ // pyeasyphd/tools/python_run_latex_md.py
212
213
  // true, false
213
214
  "generate_html": false,
214
215
 
@@ -229,7 +230,7 @@
229
230
  "delete_original_tex_in_output_folder": false,
230
231
  "delete_original_bib_in_output_folder": false,
231
232
 
232
- // pypapers/pypapers.py
233
+ // pyeasyphd/pyeasyphd.py
233
234
  // default is the same with the active file
234
235
  "path_output": "",
235
236
  }
@@ -172,7 +172,7 @@ def generate_statistic_information(path_output: str) -> None:
172
172
  informations.append(flag + "\n")
173
173
 
174
174
  # Write information to CSV file
175
- csv_path = f.replace(".bib", ".csv").replace("/bib/", "/url/")
175
+ csv_path = f.replace(".bib", ".csv").replace(f"{os.sep}bib{os.sep}", f"{os.sep}url{os.sep}")
176
176
  write_list(informations, csv_path, "w", None, False)
177
177
 
178
178
  return None
@@ -1,6 +1,7 @@
1
1
  import copy
2
2
  import os
3
3
  import re
4
+ from pathlib import Path
4
5
  from typing import Any, Dict, List
5
6
 
6
7
  from pyadvtools import (
@@ -214,11 +215,11 @@ class Searchkeywords(object):
214
215
  data_list.append(f"<td>{name}</td>\n")
215
216
 
216
217
  for f in data_dict[name]:
218
+ folders = Path(f).parts[1:]
217
219
  if index == "combine":
218
- data_list.append(x.format(f, f.split("-")[0].split("/")[-1].title() + ":" + f.split(".")[-1]))
220
+ data_list.append(x.format(f, folders[-1].split("-")[0].title() + ":" + f.split(".")[-1]))
219
221
  elif index == "separate":
220
- data_list.append(x.format(f, f.split("/")[-2].split("-")[0].title() + ":" + f.split(".")[-1]))
221
-
222
+ data_list.append(x.format(f, folders[-2].split("-")[0].title() + ":" + f.split(".")[-1]))
222
223
  data_list.append("</tr>\n")
223
224
  data_list.append("</tbody>\n")
224
225
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pyeasyphd
3
- Version: 0.0.2
3
+ Version: 0.0.4
4
4
  Summary: pyeasyphd
5
5
  License: GPL-3.0-or-later
6
6
  Keywords: Python,Markdown,LaTex
@@ -17,7 +17,7 @@ Classifier: Programming Language :: Python :: 3.11
17
17
  Classifier: Programming Language :: Python :: 3.12
18
18
  Classifier: Programming Language :: Python :: 3.13
19
19
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
- Requires-Dist: pyadvtools (>=0.0.3,<0.0.4)
20
+ Requires-Dist: pyadvtools (>=0.0.5,<0.0.6)
21
21
  Project-URL: Documentation, https://github.com/NextArtifIntell/pyeasyphd
22
22
  Project-URL: Homepage, https://github.com/NextArtifIntell/pyeasyphd
23
23
  Project-URL: Repository, https://github.com/NextArtifIntell/pyeasyphd
@@ -48,19 +48,19 @@ pyeasyphd/bib/core/convert_library_to_str.py,sha256=yvea1NUobcn2NF9CtvrjmNN1IU23
48
48
  pyeasyphd/bib/core/convert_str_to_library.py,sha256=CNB5UfSOcCqPPypxm9yIY7R7kvLQ_fzRPIqKwdegToY,1017
49
49
  pyeasyphd/bib/core/convert_str_to_str.py,sha256=jUxXD3v7t042OaMXPFlWGHjNNukpuoel12TpYt1krD4,900
50
50
  pyeasyphd/main/__init__.py,sha256=7_x6_RNSeha2zrgIbKjJgEvFWK62btOW9v6RUU1Ygm8,390
51
- pyeasyphd/main/basic_input.py,sha256=Oh-JG4BtdVimJHtINq4zkfvN4av1bJ39ZErmJISaJHE,6767
52
- pyeasyphd/main/pandoc_md_to.py,sha256=hRajMqlPl879qQKOE-MLtCE-KL9U5y2GO6et8cgkm8w,14806
51
+ pyeasyphd/main/basic_input.py,sha256=b2ilzgslD2W-10gLM3RM3zBn3-MxFkYeHeTzdILzbAU,6794
52
+ pyeasyphd/main/pandoc_md_to.py,sha256=oC9KXnMqBJKKDvtBBMLkmPmcisWvWD0XiUwv18FUEbY,14828
53
53
  pyeasyphd/main/python_run_bib.py,sha256=RRVeGXXs1MELpAYex9vT3x97Rqr211TP1aeHhD-8hXU,2891
54
54
  pyeasyphd/main/python_run_md.py,sha256=6K4zqYtl298-iS1XVGH4jY9FkDD9ezwpGfZk0NIgk2Q,10353
55
- pyeasyphd/main/python_run_tex.py,sha256=LQirSh_5Mv5t-SdAtV5Ge2aCTTkvaPNAloFTH6hkzCI,5691
55
+ pyeasyphd/main/python_run_tex.py,sha256=P5jqnyRfKyUJFvhd7LgASmwlfkHSJ0Br9_jeYwp2Ojg,5786
56
56
  pyeasyphd/main/python_writers.py,sha256=VQpaAbdNNa1s327ADgl8Wy-rKBZy1alqmtmx6E3RDWI,8510
57
57
  pyeasyphd/pyeasyphd.py,sha256=vPM4uPmr6jSxVOy0zYetoijc8wUkQdXExUVdJyWynVQ,2875
58
- pyeasyphd/pyeasyphd.sublime-settings,sha256=ZtclkJnOoZUmCLhWWsEDu3eiHyHv1JGP7g6gOMG6yEY,8664
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
61
  pyeasyphd/tools/compare/compare_bibs.py,sha256=QZlqVHbF133nnZZpzDa6jYlkHnai_x7kqgq62hpIzw0,10156
62
62
  pyeasyphd/tools/experiments_base.py,sha256=mx-vt0dpgjhsYcRyVpQkzdbJw_CFXcaaYt81w13y4Tc,7639
63
- pyeasyphd/tools/format_save_bibs.py,sha256=vChgzsg45MT6IkeN8ZuJhMdGDMIvwmH8NGr16IuQwy4,7043
63
+ pyeasyphd/tools/format_save_bibs.py,sha256=mRwrilzC4coul-Bf8aZwrCOCZB9ah_G-Zy9DcGAr_4Q,7073
64
64
  pyeasyphd/tools/generate/generate_from_bibs.py,sha256=RP-ADsmUsM6lEUaHDMAv6DSVrsx5wHyHsRVDVZwjaeM,17794
65
65
  pyeasyphd/tools/generate/generate_links.py,sha256=lnPf8FmksPDBtb30wHarr7y9cdFm3ELnKZwXIKHukyw,13700
66
66
  pyeasyphd/tools/py_run_bib_md_tex.py,sha256=lc6JqfXeJSMA8icTJTC7X1pq4tgurOaXq9f0-LSJK7g,14657
@@ -68,13 +68,13 @@ pyeasyphd/tools/replace/replace.py,sha256=wXdO72PpqZ-Iyzq5AjVCIpx8h2d1YCTiWY9VSb
68
68
  pyeasyphd/tools/search/data.py,sha256=7uHXfHTcn88zkfqAGZMNcSd2OjS2LhkpE9paNuSUUqw,10754
69
69
  pyeasyphd/tools/search/search_base.py,sha256=Q8IWqVLk-rGZwRZ316WkZNs0qyF7PVHP6lx6Ul5mLKI,4507
70
70
  pyeasyphd/tools/search/search_core.py,sha256=16nVB2j3mtrTxUJKgtYg65ux6bI81ofTHn1IAB3twPc,13783
71
- pyeasyphd/tools/search/search_keywords.py,sha256=mNlwLWSgi19KiErCb5IB433L96sBWVFWgjd5IO_GQuU,10372
71
+ pyeasyphd/tools/search/search_keywords.py,sha256=O_ivQzElsjujTHqU0Sxw4w4v3VwcN560HcoBhS1B3WA,10430
72
72
  pyeasyphd/tools/search/search_writers.py,sha256=TuQGm9QwHy0bZHNtO_qg-MYEcip_rUPfwHyvPKO-sEg,12551
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
75
  pyeasyphd/tools/spider/process_spider_url.py,sha256=YKG4GER5TiFDjyk94n1ocUQ8bM7ZvXImx0lKNvnyVC4,2970
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.2.dist-info/METADATA,sha256=pK0O12eHXWGFLRBzOsmyxyd4hXmjVjGBT9j-I1D-blg,1043
79
- pyeasyphd-0.0.2.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
80
- pyeasyphd-0.0.2.dist-info/RECORD,,
78
+ pyeasyphd-0.0.4.dist-info/METADATA,sha256=kyDu0_OV12RDFJ5_w-rfXiO_3ZgtEyadUtwH14GDdac,1043
79
+ pyeasyphd-0.0.4.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
80
+ pyeasyphd-0.0.4.dist-info/RECORD,,