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

Files changed (75) hide show
  1. pyeasyphd/.python-version +1 -1
  2. pyeasyphd/main/__init__.py +0 -4
  3. pyeasyphd/main/basic_input.py +7 -63
  4. pyeasyphd/main/python_run_md.py +3 -3
  5. pyeasyphd/main/python_run_tex.py +1 -1
  6. pyeasyphd/pyeasyphd.sublime-settings +2 -160
  7. pyeasyphd/tools/__init__.py +1 -16
  8. pyeasyphd/tools/generate/generate_from_bibs.py +54 -330
  9. pyeasyphd/tools/generate/generate_html.py +122 -0
  10. pyeasyphd/tools/generate/generate_library.py +188 -0
  11. pyeasyphd/tools/generate/generate_links.py +13 -4
  12. pyeasyphd/tools/py_run_bib_md_tex.py +12 -13
  13. pyeasyphd/tools/search/search_base.py +8 -5
  14. pyeasyphd/tools/search/search_core.py +4 -3
  15. pyeasyphd/tools/search/search_keywords.py +1 -1
  16. pyeasyphd/tools/search/search_writers.py +8 -5
  17. {pyeasyphd-0.1.0.dist-info → pyeasyphd-0.1.2.dist-info}/METADATA +3 -6
  18. pyeasyphd-0.1.2.dist-info/RECORD +27 -0
  19. pyeasyphd/bib/__init__.py +0 -1
  20. pyeasyphd/bib/bibtexbase/__init__.py +0 -7
  21. pyeasyphd/bib/bibtexbase/standardize/_base.py +0 -36
  22. pyeasyphd/bib/bibtexbase/standardize/default_data.py +0 -97
  23. pyeasyphd/bib/bibtexbase/standardize/do_on_bib.py +0 -54
  24. pyeasyphd/bib/bibtexbase/standardize/do_on_comment_block.py +0 -38
  25. pyeasyphd/bib/bibtexbase/standardize/do_on_entry_block.py +0 -310
  26. pyeasyphd/bib/bibtexbase/standardize/do_on_preamble_block.py +0 -35
  27. pyeasyphd/bib/bibtexbase/standardize/do_on_string_block.py +0 -34
  28. pyeasyphd/bib/bibtexbase/standardize_bib.py +0 -75
  29. pyeasyphd/bib/bibtexparser/__init__.py +0 -47
  30. pyeasyphd/bib/bibtexparser/bibtex_format.py +0 -87
  31. pyeasyphd/bib/bibtexparser/exceptions.py +0 -64
  32. pyeasyphd/bib/bibtexparser/library.py +0 -207
  33. pyeasyphd/bib/bibtexparser/middlewares/block/add.py +0 -94
  34. pyeasyphd/bib/bibtexparser/middlewares/block/authors.py +0 -22
  35. pyeasyphd/bib/bibtexparser/middlewares/block/doi_url.py +0 -62
  36. pyeasyphd/bib/bibtexparser/middlewares/block/entry_field_keys_normalize.py +0 -47
  37. pyeasyphd/bib/bibtexparser/middlewares/block/entry_field_keys_replace.py +0 -31
  38. pyeasyphd/bib/bibtexparser/middlewares/block/entry_field_values_normalize.py +0 -222
  39. pyeasyphd/bib/bibtexparser/middlewares/block/entry_fields_delete.py +0 -34
  40. pyeasyphd/bib/bibtexparser/middlewares/block/entry_fields_keep.py +0 -33
  41. pyeasyphd/bib/bibtexparser/middlewares/block/entry_fields_sort.py +0 -70
  42. pyeasyphd/bib/bibtexparser/middlewares/block/entry_types.py +0 -15
  43. pyeasyphd/bib/bibtexparser/middlewares/block/journal_booktitle.py +0 -113
  44. pyeasyphd/bib/bibtexparser/middlewares/block/month_year.py +0 -34
  45. pyeasyphd/bib/bibtexparser/middlewares/block/number_volume.py +0 -21
  46. pyeasyphd/bib/bibtexparser/middlewares/block/pages.py +0 -28
  47. pyeasyphd/bib/bibtexparser/middlewares/block/title.py +0 -20
  48. pyeasyphd/bib/bibtexparser/middlewares/library/generating_entrykeys.py +0 -98
  49. pyeasyphd/bib/bibtexparser/middlewares/library/keeping_blocks.py +0 -29
  50. pyeasyphd/bib/bibtexparser/middlewares/library/sorting_blocks.py +0 -124
  51. pyeasyphd/bib/bibtexparser/middlewares/middleware.py +0 -222
  52. pyeasyphd/bib/bibtexparser/middlewares/parsestack.py +0 -13
  53. pyeasyphd/bib/bibtexparser/middlewares/utils.py +0 -226
  54. pyeasyphd/bib/bibtexparser/middlewares_library_to_library.py +0 -414
  55. pyeasyphd/bib/bibtexparser/middlewares_library_to_str.py +0 -42
  56. pyeasyphd/bib/bibtexparser/middlewares_str_to_library.py +0 -35
  57. pyeasyphd/bib/bibtexparser/middlewares_str_to_str.py +0 -29
  58. pyeasyphd/bib/bibtexparser/model.py +0 -481
  59. pyeasyphd/bib/bibtexparser/splitter.py +0 -151
  60. pyeasyphd/bib/core/__init__.py +0 -18
  61. pyeasyphd/bib/core/convert_library_to_library.py +0 -31
  62. pyeasyphd/bib/core/convert_library_to_str.py +0 -199
  63. pyeasyphd/bib/core/convert_str_to_library.py +0 -34
  64. pyeasyphd/bib/core/convert_str_to_str.py +0 -27
  65. pyeasyphd/main/python_run_bib.py +0 -73
  66. pyeasyphd/main/python_writers.py +0 -212
  67. pyeasyphd/tools/compare/compare_bibs.py +0 -234
  68. pyeasyphd/tools/experiments_base.py +0 -203
  69. pyeasyphd/tools/format_save_bibs.py +0 -178
  70. pyeasyphd/tools/replace/replace.py +0 -81
  71. pyeasyphd/tools/spider/process_spider_bib.py +0 -247
  72. pyeasyphd/tools/spider/process_spider_url.py +0 -75
  73. pyeasyphd/tools/spider/process_spider_url_bib.py +0 -62
  74. pyeasyphd-0.1.0.dist-info/RECORD +0 -80
  75. {pyeasyphd-0.1.0.dist-info → pyeasyphd-0.1.2.dist-info}/WHEEL +0 -0
pyeasyphd/.python-version CHANGED
@@ -1 +1 @@
1
- 3.8
1
+ 3.13
@@ -3,15 +3,11 @@
3
3
  __all__ = [
4
4
  "BasicInput",
5
5
  "PandocMdTo",
6
- "PythonRunBib",
7
6
  "PythonRunMd",
8
7
  "PythonRunTex",
9
- "PythonWriters",
10
8
  ]
11
9
 
12
10
  from .basic_input import BasicInput
13
11
  from .pandoc_md_to import PandocMdTo
14
- from .python_run_bib import PythonRunBib
15
12
  from .python_run_md import PythonRunMd
16
13
  from .python_run_tex import PythonRunTex
17
- from .python_writers import PythonWriters
@@ -1,11 +1,11 @@
1
- import json
2
1
  import os
3
2
  from typing import Any, Dict
4
3
 
5
4
  from pyadvtools import read_list, standard_path
5
+ from pybibtexer.main import BasicInput as BasicInputInPyBibtexer
6
6
 
7
7
 
8
- class BasicInput(object):
8
+ class BasicInput(BasicInputInPyBibtexer):
9
9
  """Basic input.
10
10
 
11
11
  Args:
@@ -16,11 +16,6 @@ class BasicInput(object):
16
16
  path_figures (str): Path figures.
17
17
  path_templates (str): Path templates.
18
18
 
19
- full_abbr_article_dict (Dict[str, str]): Full abbr article dict.
20
- full_abbr_inproceedings_dict (Dict[str, str]): Full abbr inproceedings dict.
21
- full_names_in_json (str): Full names in json.
22
- abbr_names_in_json (str): Abbr names in json.
23
-
24
19
  full_csl_style_pandoc (str): Full path to csl style for pandoc.
25
20
  full_tex_article_template_pandoc (str): Full path to tex article template for pandoc.
26
21
  article_template_tex (List[str]): Article template for LaTex.
@@ -29,8 +24,8 @@ class BasicInput(object):
29
24
  article_template_tail_tex (List[str]): Article template tail for LaTex.
30
25
  beamer_template_header_tex (List[str]): Beamer template header for LaTex.
31
26
  beamer_template_tail_tex (List[str]): Beamer template tail for LaTex.
32
- tex_math_commands_tex (List[str]): Tex math commands for LaTex.
33
- tex_usepackages_tex (List[str]): Tex usepackages for LaTex.
27
+ math_commands_tex (List[str]): Tex math commands for LaTex.
28
+ usepackages_tex (List[str]): Tex usepackages for LaTex.
34
29
  handly_preamble (bool): Handly preamble.
35
30
 
36
31
  options (Dict[str, Any]): Options.
@@ -68,8 +63,9 @@ class BasicInput(object):
68
63
  self.path_templates = p
69
64
  break
70
65
 
71
- # bib/core
72
- self._initialize_middlewares(options)
66
+ full_json_c = os.path.join(self.path_templates, "AbbrFull", "conferences.json")
67
+ full_json_j = os.path.join(self.path_templates, "AbbrFull", "journals.json")
68
+ super().__init__(full_json_c, full_json_j, options)
73
69
 
74
70
  # main
75
71
  self._initialize_pandoc_md_to(options)
@@ -77,58 +73,6 @@ class BasicInput(object):
77
73
 
78
74
  self.options = options
79
75
 
80
- # bib/core
81
- def _initialize_middlewares(self, options: Dict[str, Any]) -> None:
82
- full_json_c = os.path.join(self.path_templates, "AbbrFull", "conferences.json")
83
- full_json_j = os.path.join(self.path_templates, "AbbrFull", "journals.json")
84
- if os.path.isfile(full_json_c):
85
- with open(full_json_c, "r") as f:
86
- try:
87
- json_dict = json.loads(f.read())
88
- except Exception as e:
89
- print(e)
90
- json_dict = {}
91
- full_abbr_inproceedings_dict = {p: json_dict[p].get("conferences", {}) for p in json_dict}
92
- else:
93
- full_abbr_inproceedings_dict = {}
94
-
95
- if os.path.isfile(full_json_j):
96
- with open(full_json_j, "r") as f:
97
- try:
98
- json_dict = json.loads(f.read())
99
- except Exception as e:
100
- print(e)
101
- json_dict = {}
102
- full_abbr_article_dict = {p: json_dict[p].get("journals", {}) for p in json_dict}
103
- else:
104
- full_abbr_article_dict = {}
105
-
106
- inproceedings_dict = options.get("full_abbr_inproceedings_dict", {})
107
- if len(inproceedings_dict) == 0:
108
- inproceedings_dict = full_abbr_inproceedings_dict
109
- self.full_abbr_inproceedings_dict = full_abbr_inproceedings_dict
110
-
111
- article_dict = options.get("full_abbr_article_dict", {})
112
- if len(article_dict) == 0:
113
- article_dict = full_abbr_article_dict
114
- self.full_abbr_article_dict = full_abbr_article_dict
115
-
116
- full_names_in_json = options.get("full_names_in_json", "names_full")
117
- if len(full_names_in_json) == 0:
118
- full_names_in_json = "names_full"
119
- self.full_names_in_json = full_names_in_json
120
-
121
- abbr_names_in_json = options.get("abbr_names_in_json", "names_abbr")
122
- if len(abbr_names_in_json) == 0:
123
- abbr_names_in_json = "names_abbr"
124
- self.abbr_names_in_json = abbr_names_in_json
125
-
126
- options["full_abbr_article_dict"] = self.full_abbr_article_dict
127
- options["full_abbr_inproceedings_dict"] = self.full_abbr_inproceedings_dict
128
-
129
- options["full_names_in_json"] = self.full_names_in_json
130
- options["abbr_names_in_json"] = self.abbr_names_in_json
131
-
132
76
  # main
133
77
  def _initialize_pandoc_md_to(self, options: Dict[str, Any]) -> None:
134
78
  csl_name = options.get("csl_name", "apa-no-ampersand")
@@ -11,11 +11,11 @@ from pyadvtools import (
11
11
  read_list,
12
12
  write_list,
13
13
  )
14
+ from pybibtexer.bib.core import ConvertStrToLibrary
15
+ from pybibtexer.main.python_writers import PythonWriters
14
16
 
15
- from ..bib.core import ConvertStrToLibrary
16
17
  from .basic_input import BasicInput
17
18
  from .pandoc_md_to import PandocMdTo
18
- from .python_writers import PythonWriters
19
19
 
20
20
 
21
21
  class PythonRunMd(BasicInput):
@@ -135,7 +135,7 @@ class PythonRunMd(BasicInput):
135
135
  _options = {}
136
136
  _options.update(self.options)
137
137
  _options["add_index_to_enties"] = False
138
- _python_writers = PythonWriters(_options)
138
+ _python_writers = PythonWriters(self.full_json_c, self.full_json_j, _options)
139
139
  key_url_http_bib_dict = _python_writers.output_key_url_http_bib_dict(library)
140
140
 
141
141
  content_md = []
@@ -31,7 +31,7 @@ class PythonRunTex(BasicInput):
31
31
  # for tex
32
32
  self.final_output_main_tex_name: str = options.get("final_output_main_tex_name", "")
33
33
  self.run_latex: bool = options.get("run_latex", False)
34
- self.pdflatex_xelatex: str = options.get("pdflatex_xelatex", "pdflatex") # pdflatex, xelatex
34
+ self.pdflatex_xelatex: str = options.get("pdflatex_xelatex", "xelatex") # pdflatex, xelatex
35
35
  self.delete_run_latex_cache: bool = options.get("delete_run_latex_cache", True)
36
36
  self.latex_clean_file_types: Optional[List[str]] = options.get("latex_clean_file_types", None)
37
37
 
@@ -9,146 +9,6 @@
9
9
  "path_figures": "",
10
10
  "path_templates": "",
11
11
 
12
- // pyeasyphd/bib/core/convert_str_to_str.py
13
- "default_additional_field_list": [],
14
-
15
- // pyeasyphd/bib/bibtexparser/middlewares_str_to_str.py
16
- "substitute_in_bib": true,
17
- "substitute_old_list": [],
18
- "substitute_new_list": [],
19
-
20
-
21
- // pyeasyphd/bib/core/convert_str_to_library.py
22
- "is_standardize_bib": true,
23
-
24
- // pyeasyphd/bib/bibtexparser/middlewares_str_to_library.py
25
- "is_display_implicit_comments": true,
26
-
27
-
28
- // pyeasyphd/bib/core/convert_library_to_library.py
29
- // "abbr", "zotero", or "save"
30
- "choose_abbr_zotero_save": "save",
31
-
32
- // pyeasyphd/bib/bibtexparser/middlewares_library_to_library.py
33
- "function_common_again": true,
34
- "function_common_again_abbr": true,
35
- "function_common_again_zotero": true,
36
- "function_common_again_save": true,
37
- // "is_sort_entry_fields": false,
38
- // "is_sort_blocks": false,
39
- // "sort_entries_by_cite_keys": [],
40
- // "sort_entries_by_field_keys": ["year", "volume", "number", "month", "pages"],
41
- // "sort_entries_by_field_keys_reverse": false,
42
-
43
- // for common
44
- "lower_entry_type": true,
45
- "lower_entry_field_key": true,
46
- "keep_entries_by_cite_keys": [],
47
- "update_month_year": true,
48
- "update_number_volume": true,
49
- "update_pages": true,
50
- "update_title": true,
51
- "sentence_title_case": true,
52
- "generate_entry_cite_keys": false,
53
- "full_abbr_article_dict": {},
54
- "full_abbr_inproceedings_dict": {},
55
- "full_names_in_json": "names_full",
56
- "abbr_names_in_json": "names_abbr",
57
-
58
- // special for abbr
59
- // abbreviate
60
- "full_to_abbr_for_abbr": true,
61
- // 0, 1, 2
62
- "abbr_index_article_for_abbr": 1,
63
- "abbr_index_inproceedings_for_abbr": 2,
64
-
65
- // format doi and url
66
- // keep only doi or url
67
- "doi_or_url_for_abbr": true,
68
- // change doi to url format (https://doi.org/xxx)
69
- "doi_to_url_for_abbr": true,
70
- // add link to fields
71
- "add_link_to_fields_for_abbr": null,
72
-
73
- // keep some fields for abbr
74
- // true, false
75
- "keep_fields_for_abbr": true,
76
- "keep_entry_list_for_abbr": ["article", "inproceedings", "incollection", "misc", "book", "phdthesis", "mastersthesis", "techreport"],
77
- "keep_field_list_list_for_abbr": [
78
- ["author", "title", "year", "month", "journal", "pages", "volume", "number", "doi", "url", "annotation"],
79
- ["author", "title", "year", "month", "booktitle", "pages", "doi", "url", "annotation"],
80
- ["author", "title", "year", "month", "booktitle", "pages", "publisher", "doi", "url", "annotation"],
81
- ["author", "title", "year", "month", "publisher", "howpublished", "pages", "doi", "url", "annotation"],
82
- ["author", "title", "year", "month", "publisher", "edition", "doi", "url", "annotation"],
83
- ["author", "title", "year", "month", "type", "school", "address", "pages", "doi", "url", "annotation"],
84
- ["author", "title", "year", "month", "type", "school", "address", "pages", "doi", "url", "annotation"],
85
- ["author", "title", "year", "month", "type", "institution", "address", "pages", "doi", "url", "annotation"],
86
- ],
87
-
88
- // delete fields list for abbr
89
- "delete_fields_list_for_abbr": [],
90
-
91
- // replace some fields for abbr
92
- "replace_fields_for_abbr": true,
93
- "replace_old_field_list_for_abbr": [["publisher"]],
94
- "replace_new_field_list_for_abbr": [["howpublished"]],
95
- "replace_entry_list_for_abbr": ["misc"],
96
- // constrain the number of authors for abbr
97
- "maximum_authors_for_abbr": 0,
98
-
99
- // special for zotero
100
- // format doi and url
101
- "doi_or_url_for_zotero": true,
102
-
103
- // keep some fields for zotero
104
- // true, false
105
- "keep_fields_for_zotero": true,
106
- "keep_entry_list_for_zotero": ["article", "inproceedings", "incollection", "misc", "book", "phdthesis", "mastersthesis", "techreport"],
107
- "keep_field_list_list_for_zotero": [
108
- ["abstract", "author", "title", "year", "month", "journal", "pages", "volume", "number", "doi", "url", "annotation"],
109
- ["abstract", "author", "title", "year", "month", "booktitle", "pages", "doi", "url", "annotation"],
110
- ["abstract", "author", "title", "year", "month", "booktitle", "pages", "publisher", "doi", "url", "annotation"],
111
- ["abstract", "author", "title", "year", "month", "publisher", "pages", "doi", "url", "annotation"],
112
- ["abstract", "author", "title", "year", "month", "publisher", "edition", "doi", "url", "annotation"],
113
- ["abstract", "author", "title", "year", "month", "type", "school", "address", "pages", "doi", "url", "annotation"],
114
- ["abstract", "author", "title", "year", "month", "type", "school", "address", "pages", "doi", "url", "annotation"],
115
- ["abstract", "author", "title", "year", "month", "type", "institution", "address", "pages", "doi", "url", "annotation"],
116
- ],
117
-
118
- // delete fields list for zotero
119
- "delete_fields_list_for_zotero": [],
120
-
121
- // delete redundant in `journal` or `booktitle`
122
- "delete_redundant_in_journal_booktitle": true,
123
-
124
- // title (lower, upper) journal and booktitle
125
- "title_journal_booktitle_for_zotero": true,
126
-
127
- // add field 'archive'.
128
- "add_archive_for_zotero": true,
129
-
130
- // add field 'journal abbreviation'.
131
- "add_journal_abbr_for_zotero": true,
132
-
133
- // special for save
134
- // delete fields list for save
135
- "delete_fields_list_for_save": [],
136
-
137
-
138
- // pyeasyphd/bib/core/convert_library_to_str.py
139
- "is_standardize_library": false,
140
- "empty_entry_cite_keys": false,
141
- "add_index_to_entries": false,
142
- "entries_necessary": true,
143
-
144
- // pyeasyphd/bib/bibtexparser/middlewares_library_to_str.py
145
- "is_sort_entry_fields": true,
146
- "is_sort_blocks": true,
147
- "sort_entries_by_cite_keys": [],
148
- "sort_entries_by_field_keys": ["year", "volume", "number", "month", "pages"],
149
- "sort_entries_by_field_keys_reverse": true,
150
-
151
-
152
12
  // pyeasyphd/main/pandoc_md_to.py
153
13
  // for pandoc
154
14
  "csl_name": "apa-no-ampersand",
@@ -160,20 +20,6 @@
160
20
  // "fullcite", "cite"
161
21
  "cite_flag_in_tex": "cite",
162
22
 
163
- // for bib file
164
- // pyeasyphd/main/python_writers.py
165
- // "abbr.bib", "zotero.bib", "save.bib"
166
- "bib_for_abbr_name": "abbr.bib",
167
- "bib_for_zotero_name": "zotero.bib",
168
- "bib_for_save_name": "save.bib",
169
- // "choose_abbr_zotero_save": "save",
170
- // choose multiple items ["google", "connected", "scite"]
171
- "display_google_connected_scite": ["google", "connected", "scite"],
172
- // bib format
173
- "bibtex_format_indent": " ",
174
- "bibtex_format_trailing_comma": true,
175
- "bibtex_format_block_separator": "",
176
-
177
23
  // for md file
178
24
  // pyeasyphd/main/python_run_md.py
179
25
  // default is ""
@@ -201,7 +47,7 @@
201
47
  // true, false
202
48
  "run_latex": false,
203
49
  // "pdflatex", "xelatex"
204
- "pdflatex_xelatex": "pdflatex",
50
+ "pdflatex_xelatex": "xelatex",
205
51
  // true, false
206
52
  "delete_run_latex_cache": true,
207
53
  "latex_clean_file_types": [
@@ -223,14 +69,10 @@
223
69
  "figure_folder_name": "fig", // "" or "figs" or "main"
224
70
  "bib_folder_name": "bib", // "" or "bibs" or "main"
225
71
  "md_folder_name": "md", // "" or "mds" or "main"
226
- "tex_folder_name": "tex", // "" or "texes" or "main"
72
+ "tex_folder_name": "tex", // "" or "texs" or "main"
227
73
 
228
74
  // for delete original md, tex, and bib files in output folder
229
75
  "delete_original_md_in_output_folder": false,
230
76
  "delete_original_tex_in_output_folder": false,
231
77
  "delete_original_bib_in_output_folder": false,
232
-
233
- // pyeasyphd/pyeasyphd.py
234
- // default is the same with the active file
235
- "path_output": "",
236
78
  }
@@ -2,29 +2,14 @@
2
2
 
3
3
  __all__ = [
4
4
  "PyRunBibMdTex",
5
- "format_entries_for_abbr_zotero_save",
6
- "generate_statistic_information",
7
-
8
- "generate_standard_publisher_abbr_options_dict",
9
5
 
10
6
  "Searchkeywords",
11
- "generate_from_bibs_and_write",
12
7
 
8
+ "generate_from_bibs_and_write",
13
9
  "PaperLinksGenerator",
14
-
15
- "compare_bibs_with_local",
16
- "compare_bibs_with_zotero",
17
- "replace_to_standard_cite_keys",
18
-
19
- "CheckDeleteFormatMoveSpideredBibs",
20
10
  ]
21
11
 
22
- from .compare.compare_bibs import compare_bibs_with_local, compare_bibs_with_zotero
23
- from .experiments_base import generate_standard_publisher_abbr_options_dict
24
- from .format_save_bibs import format_entries_for_abbr_zotero_save, generate_statistic_information
25
12
  from .generate.generate_from_bibs import generate_from_bibs_and_write
26
13
  from .generate.generate_links import PaperLinksGenerator
27
14
  from .py_run_bib_md_tex import PyRunBibMdTex
28
- from .replace.replace import replace_to_standard_cite_keys
29
15
  from .search.search_keywords import Searchkeywords
30
- from .spider.process_spider_url_bib import CheckDeleteFormatMoveSpideredBibs