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
@@ -1,81 +0,0 @@
1
- import os
2
- import re
3
- from typing import Any, Dict, List, Union
4
-
5
- from pyadvtools import standard_path, transform_to_data_list, write_list
6
-
7
- from ...bib.bibtexparser import Library
8
- from ...main import PythonRunBib, PythonWriters
9
-
10
-
11
- def replace_to_standard_cite_keys(
12
- full_tex_md: str, full_bib: str, path_output: str, options: Dict[str, Any]
13
- ) -> List[str]:
14
- ext = os.path.splitext(full_tex_md)[-1]
15
- if ext not in [".tex", ".md", "md", "tex"]:
16
- print(f"{full_tex_md} must be `.tex` or `.md` file.")
17
- return []
18
-
19
- path_output = standard_path(path_output)
20
-
21
- bib_data = transform_to_data_list(full_bib, ".bib")
22
- old_key_new_entry_dict = generate_old_key_new_entry_dict(bib_data, options)
23
-
24
- data = "".join(transform_to_data_list(full_tex_md, ext))
25
- for old_key, new_entry in old_key_new_entry_dict.items():
26
- if ext == ".tex":
27
- data = re.sub(r"\\cite([a-z]*){\s*" + old_key + r"\s*}", r"\\cite\1{" + new_entry.key + "}", data)
28
- data = re.sub(r"\\cite([a-z]*){\s*" + old_key + r"\s*,", r"\\cite\1{" + new_entry.key + ",", data)
29
- data = re.sub(r",\s*" + old_key + r"\s*,", r"," + new_entry.key + r",", data)
30
- data = re.sub(r",\s*" + old_key + r"\s*}", r"," + new_entry.key + "}", data)
31
- elif ext == ".md":
32
- data = re.sub(r"\[@\s*" + old_key + r"\s*\]", r"[@" + new_entry.key + "]", data)
33
- data = re.sub(r"\[@\s*" + old_key + r"\s*,", r"[@" + new_entry.key + ",", data)
34
- data = re.sub(r",\s*" + old_key + r"\s*,", r"," + new_entry.key + r",", data)
35
- data = re.sub(r",\s*" + old_key + r"\s*\]", r"," + new_entry.key + "]", data)
36
- else:
37
- pass
38
- data_list = data.splitlines(keepends=True)
39
- write_list(data_list, f"new{ext}", "w", path_output, False)
40
-
41
- _options = {}
42
- _options.update(options)
43
- _options["is_sort_blocks"] = False # default is True
44
- _python_write = PythonWriters(_options)
45
- _python_write.write_to_file(list(old_key_new_entry_dict.values()), "new.bib", "w", path_output, False)
46
- return data_list
47
-
48
-
49
- def generate_old_key_new_entry_dict(bib_data: Union[List[str], str], options: Dict[str, Any]) -> dict:
50
- # generate library
51
- _options = {}
52
- _options.update(options)
53
- _options["generate_entry_cite_keys"] = False # default is False
54
- _python_bib = PythonRunBib(_options)
55
- library = _python_bib.parse_to_single_standard_library(bib_data)
56
-
57
- _options = {}
58
- _options.update(options)
59
- _options["generate_entry_cite_keys"] = True # default is False
60
- _python_bib = PythonRunBib(_options)
61
-
62
- old_key_new_entry_dict = {}
63
- generate_cite_keys: List[str] = []
64
- for old_key in (entries_dict := library.entries_dict):
65
- new_library = _python_bib.parse_to_single_standard_library(Library([entries_dict[old_key]]))
66
- if len(new_library.entries) == 1:
67
- new_entry = new_library.entries[0]
68
-
69
- # update cite key
70
- new_key = new_entry.key
71
- while new_key in generate_cite_keys:
72
- new_key += "-a"
73
- new_entry.key = new_key
74
-
75
- # save
76
- generate_cite_keys.append(new_entry.key)
77
- old_key_new_entry_dict[old_key] = new_entry
78
-
79
- else:
80
- old_key_new_entry_dict[old_key] = entries_dict[old_key]
81
- return old_key_new_entry_dict
@@ -1,247 +0,0 @@
1
- import copy
2
- import os
3
- import re
4
- import time
5
-
6
- from pyadvtools import (
7
- IterateCombineExtendDict,
8
- iterate_obtain_full_file_names,
9
- read_list,
10
- standard_path,
11
- write_list,
12
- )
13
-
14
- from ...bib.bibtexparser.library import Library
15
- from ...main import PythonRunBib, PythonWriters
16
- from ..experiments_base import generate_readme
17
- from ..format_save_bibs import format_entries_for_abbr_zotero_save, generate_statistic_information
18
-
19
- EXCLUDE_ABBR_LIST = ["arxiv", "biorxiv", "ssrn"]
20
-
21
-
22
- class ProcessSpiderBib(object):
23
- """Process spider bib.
24
-
25
- Args:
26
- path_abbr: The path of the abbreviation folder.
27
- abbr_standard: The standard abbreviation.
28
-
29
- Attributes:
30
- path_abbr: The path of the abbreviation folder.
31
- abbr_standard: The standard abbreviation.
32
- """
33
-
34
- def __init__(self, path_abbr: str, abbr_standard: str) -> None:
35
- self.path_abbr = os.path.expandvars(os.path.expanduser(path_abbr))
36
- self.abbr_standard = abbr_standard
37
-
38
- self._options = {
39
- "is_standardize_bib": True, # default is True
40
- "substitute_old_list": [
41
- r"(<[a-zA-Z\-]+\s*/*\s*>)",
42
- r'(</[a-zA-Z\-]+>)',
43
- r'(<[a-zA-Z\-]+ [^\s]+="[^>]+?"\s*/*\s*>)',
44
- r"([ ]+)",
45
- r";[; ]*;",
46
- r",[, ]*,"
47
- ],
48
- "substitute_new_list": ["", "", "", " ", ";", ","],
49
- "is_sort_entry_fields": True, # default is False
50
- "is_sort_blocks": True, # default is False
51
- "sort_entries_by_field_keys_reverse": False, # default is True
52
- "empty_entry_cite_keys": True,
53
- }
54
-
55
- self._python_bib = PythonRunBib(self._options)
56
-
57
- def format_spider_bib(self, write_bib: bool = False) -> None:
58
- """Format spider bib."""
59
- file_list = iterate_obtain_full_file_names(self.path_abbr, ".bib", False)
60
-
61
- if write_bib:
62
- if os.path.exists(readme := os.path.join(self.path_abbr, "README.md")):
63
- os.remove(readme)
64
-
65
- _options = {}
66
- _options.update(self._options)
67
- _python_writer = PythonWriters(_options)
68
-
69
- for f in file_list:
70
- print("*" * 5 + f" Format {os.path.basename(f)} " + "*" * 5)
71
-
72
- data_list = read_list(f, "r")
73
-
74
- # standardize
75
- entry_type_year_volume_number_month_entry_dict = self._python_bib.parse_to_nested_entries_dict(data_list)
76
- if not write_bib:
77
- continue
78
-
79
- # just for the necessary part
80
- old_readme_md = [re.sub(r"[ ]+", "", line) for line in read_list("README.md", "r", self.path_abbr)]
81
- new_readme_md = []
82
- new_entry_list = []
83
-
84
- for entry_type in entry_type_year_volume_number_month_entry_dict:
85
- new_dict = entry_type_year_volume_number_month_entry_dict.get(entry_type.lower(), {})
86
-
87
- # for README.md
88
- readme_md = generate_readme(self.abbr_standard, entry_type.lower(), new_dict)
89
- readme_md = readme_md[3:] if (old_readme_md or new_readme_md) else readme_md
90
- readme_md = [line for line in readme_md if re.sub(r"[ ]+", "", line) not in old_readme_md]
91
- new_readme_md.extend(readme_md)
92
-
93
- # for bib
94
- entry_list = IterateCombineExtendDict().dict_update(copy.deepcopy(new_dict))
95
- new_entry_list.extend(entry_list)
96
-
97
- write_list(new_readme_md, "README.md", "a", self.path_abbr, False)
98
- _python_writer.write_to_file(new_entry_list, f, "w", None, False)
99
- return None
100
-
101
- def check_spider_bib(self, delete_duplicate_in_bibs: bool = False) -> None:
102
- """Check bib."""
103
- bibs_name = iterate_obtain_full_file_names(self.path_abbr, ".bib", False)
104
- bibs_name = [[f, os.path.basename(f).split(".")[0].strip()] for f in bibs_name]
105
-
106
- urls_name = iterate_obtain_full_file_names(self.path_abbr, ".csv", False)
107
- urls_name = [[f, os.path.basename(f).split(".")[0].strip()] for f in urls_name]
108
-
109
- url_base_names = [name[-1] for name in urls_name]
110
-
111
- _options = {}
112
- _options.update(self._options)
113
- _python_writer = PythonWriters(_options)
114
-
115
- for name in bibs_name:
116
- bib_base_name = name[-1]
117
- if bib_base_name not in url_base_names:
118
- print(f"{bib_base_name}.csv not in the folder `url`.")
119
- continue
120
-
121
- full_bib, full_url = name[0], urls_name[url_base_names.index(bib_base_name)][0]
122
-
123
- print("*" * 5 + f" Check {os.path.basename(full_bib)} and {os.path.basename(full_url)} " + "*" * 5)
124
- bib_list = read_list(full_bib, "r")
125
-
126
- # Check duplicated blocks in bib file
127
- library = self._python_bib.parse_to_single_standard_library(bib_list)
128
-
129
- url_bib_dict = {}
130
- for entry in library.entries:
131
- doi = entry["doi"] if "doi" in entry else ""
132
- url_ = entry["url"] if "url" in entry else ""
133
- url = doi if doi else url_
134
- url_bib_dict.setdefault(url, []).append(entry)
135
-
136
- duplicate_url, new_entries = [], []
137
- for url in url_bib_dict:
138
- if len(url_bib_dict[url]) > 1:
139
- duplicate_url.append(url)
140
- if delete_duplicate_in_bibs:
141
- new_entries.append(url_bib_dict[url][0])
142
-
143
- # Delete duplicated blocks in bib file
144
- if duplicate_url:
145
- print(f"Duplicates in {full_bib}: {duplicate_url}\n")
146
- if duplicate_url and delete_duplicate_in_bibs:
147
- _python_writer.write_to_file(new_entries, full_bib, "w", None, False)
148
- return None
149
-
150
- def move_spider_bib(self, path_shutil: str) -> None:
151
- if self.abbr_standard.lower() in EXCLUDE_ABBR_LIST:
152
- return None
153
-
154
- # Move
155
- print("*" * 5 + f" Start moving {self.abbr_standard} ... " + "*" * 5)
156
- path_move = os.path.join(path_shutil, self.abbr_standard)
157
- entry_type_entry_dict = {}
158
- library = PythonRunBib({}).parse_to_single_standard_library(self.path_abbr)
159
- for entry in library.entries:
160
- entry_type_entry_dict.setdefault(entry.entry_type, []).append(entry)
161
- for entry_type in entry_type_entry_dict:
162
- format_entries_for_abbr_zotero_save(
163
- self.abbr_standard,
164
- path_move,
165
- Library(entry_type_entry_dict[entry_type]),
166
- combine_year_length=1,
167
- default_year_list=self._default_year_list(entry_type),
168
- write_flag_bib="a",
169
- check_bib_exist=False,
170
- write_flag_readme="a",
171
- check_md_exist=False,
172
- options=self._options,
173
- )
174
- generate_statistic_information(path_move)
175
- print("*" * 5 + " Successfully moving ... " + "*" * 5)
176
-
177
- # Delete
178
- _options = {}
179
- _options.update(self._options)
180
- _python_writer = PythonWriters(_options)
181
- print("*" * 5 + f" Start deleting {self.abbr_standard} ... " + "*" * 5)
182
- bibs = iterate_obtain_full_file_names(self.path_abbr, ".bib")
183
- for bib in bibs:
184
- new_entries = []
185
- library = self._python_bib.parse_to_single_standard_library(read_list(bib, "r"))
186
- for entry in library.entries:
187
- year = entry["year"] if "year" in entry else ""
188
- if year not in self._default_year_list(entry.entry_type):
189
- new_entries.append(entry)
190
- _python_writer.write_to_file(new_entries, bib, "w", None, False, True, True, False, True)
191
- print("*" * 5 + " Successfully deleting ... " + "*" * 5)
192
-
193
- @staticmethod
194
- def _default_year_list(entry_type) -> list:
195
- year = int(time.strftime("%Y", time.localtime()))
196
- month = int(time.strftime("%m", time.localtime()))
197
- m = 0 if month <= 3 else 1
198
- if entry_type == "article":
199
- default_year_list = [str(i) for i in range(1800, year + m - 1)]
200
- elif entry_type == "inproceedings":
201
- default_year_list = [str(i) for i in range(1800, year + 2)]
202
- else:
203
- default_year_list = [str(i) for i in range(1800, year + m - 1)]
204
- return default_year_list
205
-
206
- def simplify_early_access(self):
207
- # for IEEE Early Access
208
- path_ieee_early_access = self.path_abbr
209
- path_ieee = path_ieee_early_access.replace("spider_j_e", "spider_j")
210
-
211
- _options = {}
212
- _options.update(self._options)
213
- _python_writer = PythonWriters(_options)
214
-
215
- print(f"***** Simplify {self.abbr_standard} *****")
216
- path_url_ieee_early_access = os.path.join(path_ieee_early_access, "url")
217
- path_bib_ieee_early_access = os.path.join(path_ieee_early_access, "bib")
218
- path_url_ieee = os.path.join(path_ieee, "url")
219
-
220
- # for txt urls
221
- data_list = read_list(f"{self.abbr_standard}_0.txt", "r", path_url_ieee_early_access)
222
- for name in [f for f in os.listdir(path_url_ieee) if f.endswith(".txt")]:
223
- temp_data_list = read_list(name, "r", path_url_ieee)
224
- data_list = list(set(data_list).difference(set(temp_data_list)))
225
- write_list(sorted(data_list), f"{self.abbr_standard}_0.txt", "w", path_url_ieee_early_access, False)
226
-
227
- # for csv urls
228
- data_list_csv = read_list(f"{self.abbr_standard}_0.csv", "r", path_url_ieee_early_access)
229
- data_list_txt = read_list(f"{self.abbr_standard}_0.txt", "r", path_url_ieee_early_access)
230
- data_list = list(set(data_list_csv).intersection(set(data_list_txt)))
231
- write_list(sorted(data_list), f"{self.abbr_standard}_0.csv", "w", path_url_ieee_early_access, False)
232
-
233
- # for bibs
234
- data_list_bib = read_list(f"{self.abbr_standard}_0.bib", "r", path_bib_ieee_early_access)
235
- data_list_url = read_list(f"{self.abbr_standard}_0.txt", "r", path_url_ieee_early_access)
236
-
237
- entries = []
238
- library = self._python_bib.parse_to_single_standard_library(data_list_bib)
239
- for url in data_list_url:
240
- for entry in library.entries:
241
- if standard_path(url) == standard_path(entry["url"]):
242
- entries.append(entry)
243
- break
244
-
245
- _python_writer.write_to_file(
246
- entries, f"{self.abbr_standard}_0.bib", "w", path_bib_ieee_early_access, False, True, True, True
247
- )
@@ -1,75 +0,0 @@
1
- import os
2
- import re
3
- from typing import Dict, List
4
-
5
- from pyadvtools import IterateSortDict, read_list, sort_int_str, write_list
6
-
7
-
8
- class ProcessSpiderUrl(object):
9
- """Process spider URL.
10
-
11
- Args:
12
- path_abbr (str): path to abbreviation
13
- abbr_standard (str): abbreviation standard
14
-
15
- Attributes:
16
- path_abbr (str): path to abbreviation
17
- abbr_standard (str): abbreviation standard
18
- """
19
-
20
- def __init__(self, path_abbr, abbr_standard: str) -> None:
21
- self.path_abbr = os.path.expandvars(os.path.expanduser(path_abbr))
22
- self.abbr_standard = abbr_standard
23
-
24
- def check_spider_url(
25
- self,
26
- folder_start_swith: str = "url",
27
- extension: str = ".txt",
28
- write_flag: bool = False,
29
- iterate_check_url: bool = False,
30
- ) -> None:
31
- if os.path.exists(self.path_abbr):
32
- for i in [f for f in os.listdir(self.path_abbr) if f.startswith(folder_start_swith)]:
33
- ll = os.path.join(os.path.basename(self.path_abbr), i)
34
- print("*" * 5 + f" Check *{extension} .{os.sep}{ll}")
35
- self._check_delete(os.path.join(self.path_abbr, i), extension, write_flag, iterate_check_url)
36
-
37
- def _check_delete(
38
- self, path_storage: str, extension: str = ".txt", write_flag: bool = False, iterate_check_url: bool = False
39
- ) -> None:
40
- data_dict: Dict[str, Dict[str, List[str]]] = {}
41
- files = [f for f in os.listdir(path_storage) if f.endswith(extension)]
42
- for f in files:
43
- mch = re.match(r"([a-zA-Z]+)_([\w\-]+)", f)
44
- if mch:
45
- a, b = mch.groups()
46
- data_dict.setdefault(a, {}).setdefault(b, []).extend(read_list(f, "r", path_storage))
47
-
48
- for a in IterateSortDict(False).dict_update(data_dict):
49
- b_list = sort_int_str(list(data_dict[a].keys()))
50
-
51
- for b in b_list:
52
- new_temp_list: List[str] = []
53
- duplicate_dict: Dict[str, List[str]] = {}
54
- for line in data_dict[a][b]:
55
- line_flag = False
56
- if iterate_check_url:
57
- for bb in b_list[: b_list.index(b)]:
58
- if line in data_dict[a][bb]:
59
- duplicate_dict.setdefault(f"{a}_{b} and {a}_{bb}", []).append(line.strip())
60
- line_flag = True
61
- break
62
-
63
- if (not line_flag) and (line not in new_temp_list):
64
- new_temp_list.append(line)
65
- elif line in new_temp_list:
66
- print(f"Duplicate item {line.strip()} in {a}_{b}{extension}.\n")
67
-
68
- data_dict[a][b] = new_temp_list
69
-
70
- if duplicate_dict:
71
- print(f"Duplicate items in {extension}:\n", duplicate_dict)
72
-
73
- if write_flag:
74
- write_list(new_temp_list, f"{a}_{b}{extension}", "w", path_storage, False, True, True, True)
75
- return None
@@ -1,62 +0,0 @@
1
- import os
2
- from typing import Any, Dict
3
-
4
- from pyadvtools import standard_path
5
-
6
- from ..experiments_base import generate_standard_publisher_abbr_options_dict
7
- from ..spider.process_spider_bib import ProcessSpiderBib
8
- from ..spider.process_spider_url import ProcessSpiderUrl
9
-
10
-
11
- class CheckDeleteFormatMoveSpideredBibs(object):
12
- """Experiment for check.
13
-
14
- Args:
15
- path_storage (str): path to storage
16
- path_shutil (str): path to shutil
17
- options (Dict[str, Any]): options for check, delete, format
18
-
19
- Attributes:
20
- path_storage (str): path to storage
21
- path_shutil (str): path to shutil
22
- publisher_abbr_dict (Dict[str, Dict[str, Any]]): publisher abbreviation options dict
23
- """
24
-
25
- def __init__(self, path_storage: str, path_shutil: str, options: Dict[str, Any]) -> None:
26
- self.path_storage = standard_path(path_storage)
27
- self.path_shutil = standard_path(path_shutil)
28
- self.publisher_abbr_dict = generate_standard_publisher_abbr_options_dict(self.path_storage, options)
29
-
30
- def check_delete_format_move(self) -> None:
31
- publisher_abbr_dict = self.publisher_abbr_dict
32
- for publisher in self.publisher_abbr_dict:
33
- for abbr_standard in publisher_abbr_dict[publisher]:
34
- self._check_format_check_move(publisher, abbr_standard, publisher_abbr_dict[publisher][abbr_standard])
35
-
36
- def _check_format_check_move(self, publisher: str, abbr_standard: str, options: Dict[str, Any]) -> None:
37
- path_abbr = os.path.join(self.path_storage, f"{publisher.lower()}/{abbr_standard}")
38
-
39
- # for urls
40
- if options.get("check_duplicate_url", False) is True:
41
- ddu = options.get("delete_duplicate_url", False)
42
- icdu = options.get("iterate_check_duplicate_url", False)
43
- for extension in [".txt", ".csv"]:
44
- ProcessSpiderUrl(path_abbr, abbr_standard).check_spider_url("url", extension, ddu, icdu)
45
-
46
- # for bibs
47
- if options.get("format_bib", False) is True:
48
- wb = options.get("write_bib", False)
49
- ProcessSpiderBib(path_abbr, abbr_standard).format_spider_bib(wb)
50
-
51
- if options.get("check_duplicate_bib", False) is True:
52
- ddb = options.get("delete_duplicate_bib", False)
53
- ProcessSpiderBib(path_abbr, abbr_standard).check_spider_bib(ddb)
54
-
55
- if options.get("move_bib", False) is True:
56
- ps = os.path.join(self.path_shutil, publisher.lower())
57
- ProcessSpiderBib(path_abbr, abbr_standard).move_spider_bib(ps)
58
-
59
- # for early access
60
- if options.get("early_access", False):
61
- ProcessSpiderBib(path_abbr, abbr_standard).simplify_early_access()
62
- return None
@@ -1,80 +0,0 @@
1
- pyeasyphd/.python-version,sha256=D6BK33IU5_SPJZB59_rpMy1cN6QwcHafPQUvGpjilS8,3
2
- pyeasyphd/Main.sublime-menu,sha256=6IKSvXyUSqq-eXrzSVGbzakbrPzw9n7hKe-p-FXmDXM,1561
3
- pyeasyphd/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
- pyeasyphd/bib/__init__.py,sha256=lmagLbnGjT6-G_l-hUYxqjVJzgy-M_adA5tWcRRDOQc,22
5
- pyeasyphd/bib/bibtexbase/__init__.py,sha256=vUlnW7ZdoKIaWJpJ5wQWWln33YlQ9rqutwBq2FVOOcw,103
6
- pyeasyphd/bib/bibtexbase/standardize/_base.py,sha256=LEoU3XlaXAme6QVQtrb7_Q1_rmC9btr_qyLknF3T7gQ,1179
7
- pyeasyphd/bib/bibtexbase/standardize/default_data.py,sha256=g1O6PBv0XQXMiZiOadXbGGrWF42pw-2XM3YztkkwUnE,1661
8
- pyeasyphd/bib/bibtexbase/standardize/do_on_bib.py,sha256=1XBUBrregg_7l2XhTZkVfaBP3e5ApKEeGfHivg75nw0,1745
9
- pyeasyphd/bib/bibtexbase/standardize/do_on_comment_block.py,sha256=TTlkgtCxBUw7qfMdfB62R-zzgnQ0ypvRG2EpV3hFygM,1266
10
- pyeasyphd/bib/bibtexbase/standardize/do_on_entry_block.py,sha256=OfPMwWsmFLETY5uKl1QS7wgwFdngVabJlt5ywY3vRDk,11488
11
- pyeasyphd/bib/bibtexbase/standardize/do_on_preamble_block.py,sha256=D1nEEbzn_jbFLD3v1qgi8Kty13p-VF5jthBjNYHw3LQ,1194
12
- pyeasyphd/bib/bibtexbase/standardize/do_on_string_block.py,sha256=4ZUx6UuYc3J6uFuWGsR22Xl7UcmRqCIQc3S-tMuuXBY,1159
13
- pyeasyphd/bib/bibtexbase/standardize_bib.py,sha256=4uVL0z89sUzroAR1cyFy4nx4ARiVU3n52HCxOYJyXDQ,3020
14
- pyeasyphd/bib/bibtexparser/__init__.py,sha256=AuUumw0aSvRS9oUcTHd-RNKBvAAJHD-YdKEfAuKVubY,1215
15
- pyeasyphd/bib/bibtexparser/bibtex_format.py,sha256=uetBL8GFwrEqLJDe1_78MoY5lghfT9dZ6FwlgqKbv2E,3120
16
- pyeasyphd/bib/bibtexparser/exceptions.py,sha256=46MT8CHDj8pLq_951MWx-DXHWGo3zo9uZ58Zie7AjHc,2069
17
- pyeasyphd/bib/bibtexparser/library.py,sha256=Cw7nwxDr3k7sOAkhkbyHvtT6TY_xrSFN8n0TCJ57nbM,8341
18
- pyeasyphd/bib/bibtexparser/middlewares/block/add.py,sha256=UjabXwPYd6m9XDo2N3uHovQdTbmzbv5lCzW6XRcn-CQ,3300
19
- pyeasyphd/bib/bibtexparser/middlewares/block/authors.py,sha256=oggBBDg8ps5i6jLWad-JOKxKfa1cikTZUCFzwlx-qx0,863
20
- pyeasyphd/bib/bibtexparser/middlewares/block/doi_url.py,sha256=lfbO8_mtKsA4Jcl0FDcjQVOIuaWmjF-6BCDJ3I7WypY,2326
21
- pyeasyphd/bib/bibtexparser/middlewares/block/entry_field_keys_normalize.py,sha256=DfT2EkwFSQ2svhz5rktKuZp2Q1seqgINYrBjKvQNppE,1915
22
- pyeasyphd/bib/bibtexparser/middlewares/block/entry_field_keys_replace.py,sha256=2l4Tb5oAuVQjIU34CIwoKaLmhlPgFc9pMz6D02XpxWA,1020
23
- pyeasyphd/bib/bibtexparser/middlewares/block/entry_field_values_normalize.py,sha256=r85H_eWm2HTuz2GnIJsM8NsEKGoUd692IKcWSh23fX8,9538
24
- pyeasyphd/bib/bibtexparser/middlewares/block/entry_fields_delete.py,sha256=QWiyh1cBMxJmkGnDVcnxbxqSY17-ZA8P9LD2w4NjUYA,1069
25
- pyeasyphd/bib/bibtexparser/middlewares/block/entry_fields_keep.py,sha256=Hqkne-SQX2VYsgpM0YGzfPs0X83LqDDbn2x6B7sjiuw,1277
26
- pyeasyphd/bib/bibtexparser/middlewares/block/entry_fields_sort.py,sha256=YJCGdDmiFODLZe8Pzol0LYtSEokOWsQeGvdzqp10F8c,2521
27
- pyeasyphd/bib/bibtexparser/middlewares/block/entry_types.py,sha256=FhO_3gOQhSh0BUowi0Xn5jQHxwoBvXApOqIR8zm2dAs,541
28
- pyeasyphd/bib/bibtexparser/middlewares/block/journal_booktitle.py,sha256=cpTy9Yag__0UnPGhBuctvwBw79MilboqSbGPtXJsE64,4441
29
- pyeasyphd/bib/bibtexparser/middlewares/block/month_year.py,sha256=NXZF6kxixYc7yNc0_MkBVyWe5PaHLf3UfD5lO2CAv1g,1430
30
- pyeasyphd/bib/bibtexparser/middlewares/block/number_volume.py,sha256=1KmlBhLppjqww8OVmiDGgf7kXMD2VcGoBBVKOL0Q054,811
31
- pyeasyphd/bib/bibtexparser/middlewares/block/pages.py,sha256=71pWY1nuhV_d7aWkVeYU6iIAKnUY_3Q9w-KTzwJz83Y,1180
32
- pyeasyphd/bib/bibtexparser/middlewares/block/title.py,sha256=m_La5n795PT8LU-1cKubn57Bd6U0iChwUHmgX9rEcrM,727
33
- pyeasyphd/bib/bibtexparser/middlewares/library/generating_entrykeys.py,sha256=KospQjj7aO8FbY0HSlg35BlR9zPCXt1Ba2nILjQIEKo,3567
34
- pyeasyphd/bib/bibtexparser/middlewares/library/keeping_blocks.py,sha256=DpQxFdGXkF27x8ojV3DN8qwsBU1J44VsDcwV1AVR5u8,897
35
- pyeasyphd/bib/bibtexparser/middlewares/library/sorting_blocks.py,sha256=S8bQLuKcB9t0ox1Kq3GBXnhjhntKBrvuA7vVDHbkvaY,4758
36
- pyeasyphd/bib/bibtexparser/middlewares/middleware.py,sha256=mV4rn7aDJxqbBiAbo34xT2CsnNGewldcjWdE7Edu0dk,8860
37
- pyeasyphd/bib/bibtexparser/middlewares/parsestack.py,sha256=p1IG2glZyg0dywCYHhRx3eMC5GaX9IlepV3uzbFEb8s,464
38
- pyeasyphd/bib/bibtexparser/middlewares/utils.py,sha256=mLInKc651KIvkgt4_k73E6dz6WCmDpQmabxzwDKm3hk,4753
39
- pyeasyphd/bib/bibtexparser/middlewares_library_to_library.py,sha256=HopklPZl4Vm2xgRYFOA8hVSyW0BeeRwaNcCGVDIzCCk,20411
40
- pyeasyphd/bib/bibtexparser/middlewares_library_to_str.py,sha256=LZk06IyZFaga1WETU6IhqO3Lm7m-F5caWzGit3b-pOM,2008
41
- pyeasyphd/bib/bibtexparser/middlewares_str_to_library.py,sha256=931mKNxiP6zlBFtYP8xHd7x2n12My01dF_VWGIXySIU,1090
42
- pyeasyphd/bib/bibtexparser/middlewares_str_to_str.py,sha256=2JcfiYDk6dpJ51-EUwKUjG6-WAyI3qDgCalpbxbdGVg,1086
43
- pyeasyphd/bib/bibtexparser/model.py,sha256=YSMUznMRRsNGThRKjof6JeEyFrSpEG9dw9FUM6x-drw,15346
44
- pyeasyphd/bib/bibtexparser/splitter.py,sha256=waiNi5jnN6q8Iwbtzgy3soYKCEMU_1433VLc62TMM9k,6365
45
- pyeasyphd/bib/core/__init__.py,sha256=YRclQ4sZJFwOujh2eyhfhytui0LiTGNX6xzz90BuLiQ,662
46
- pyeasyphd/bib/core/convert_library_to_library.py,sha256=kSiFVkGyANUGX4e1zAy-L4YyPo4-e1rjnCWkN1a_dm4,1092
47
- pyeasyphd/bib/core/convert_library_to_str.py,sha256=yvea1NUobcn2NF9CtvrjmNN1IU23z7bJZ_G3-QwyWQI,7303
48
- pyeasyphd/bib/core/convert_str_to_library.py,sha256=CNB5UfSOcCqPPypxm9yIY7R7kvLQ_fzRPIqKwdegToY,1017
49
- pyeasyphd/bib/core/convert_str_to_str.py,sha256=jUxXD3v7t042OaMXPFlWGHjNNukpuoel12TpYt1krD4,900
50
- pyeasyphd/main/__init__.py,sha256=7_x6_RNSeha2zrgIbKjJgEvFWK62btOW9v6RUU1Ygm8,390
51
- pyeasyphd/main/basic_input.py,sha256=NvY6m5anBmzoUWKkHOmCOQoE8unsIcEtiL3HGO5lIrY,7830
52
- pyeasyphd/main/pandoc_md_to.py,sha256=SPbQBlAvfB5hcXmfKlMDc2zoT2nJ_uQNyw8bHeiyy1s,15280
53
- pyeasyphd/main/python_run_bib.py,sha256=RRVeGXXs1MELpAYex9vT3x97Rqr211TP1aeHhD-8hXU,2891
54
- pyeasyphd/main/python_run_md.py,sha256=6K4zqYtl298-iS1XVGH4jY9FkDD9ezwpGfZk0NIgk2Q,10353
55
- pyeasyphd/main/python_run_tex.py,sha256=BNSXp0KnxvYyXr5q43Sr4NwD32EiGaqZJ0QYDwit0tw,5937
56
- pyeasyphd/main/python_writers.py,sha256=VQpaAbdNNa1s327ADgl8Wy-rKBZy1alqmtmx6E3RDWI,8510
57
- pyeasyphd/pyeasyphd.py,sha256=vPM4uPmr6jSxVOy0zYetoijc8wUkQdXExUVdJyWynVQ,2875
58
- pyeasyphd/pyeasyphd.sublime-settings,sha256=6D5SYWsG6xn8OEu6IchIDGGGH7uLX4v451X28yeAevU,8718
59
- pyeasyphd/pyeasyphd.sublime-syntax,sha256=pXylbA-tye-K5dCTjEJLFVRqtY1T7AgWZ4laxo-dnaE,73
60
- pyeasyphd/tools/__init__.py,sha256=4l2e19MWmVrAvIH3IOA7v1EPaaBBvuq1UbXhmd6_bts,1041
61
- pyeasyphd/tools/compare/compare_bibs.py,sha256=9Pd3ZuLNgP4yVM4_7O9WMVg6e7VuHnMKXxgv8tHTjsI,10167
62
- pyeasyphd/tools/experiments_base.py,sha256=mx-vt0dpgjhsYcRyVpQkzdbJw_CFXcaaYt81w13y4Tc,7639
63
- pyeasyphd/tools/format_save_bibs.py,sha256=mRwrilzC4coul-Bf8aZwrCOCZB9ah_G-Zy9DcGAr_4Q,7073
64
- pyeasyphd/tools/generate/generate_from_bibs.py,sha256=5rdIvcU62MDmyND6HIwrnm2zC6hhLQOwPetVn1EnGRI,17917
65
- pyeasyphd/tools/generate/generate_links.py,sha256=2U6sA8YfNz5cNPA1TEGM6oe3yny0crrnspbeHudiAPs,14384
66
- pyeasyphd/tools/py_run_bib_md_tex.py,sha256=lc6JqfXeJSMA8icTJTC7X1pq4tgurOaXq9f0-LSJK7g,14657
67
- pyeasyphd/tools/replace/replace.py,sha256=wXdO72PpqZ-Iyzq5AjVCIpx8h2d1YCTiWY9VSbQAVvs,3337
68
- pyeasyphd/tools/search/data.py,sha256=7uHXfHTcn88zkfqAGZMNcSd2OjS2LhkpE9paNuSUUqw,10754
69
- pyeasyphd/tools/search/search_base.py,sha256=Q8IWqVLk-rGZwRZ316WkZNs0qyF7PVHP6lx6Ul5mLKI,4507
70
- pyeasyphd/tools/search/search_core.py,sha256=Gn_9vWojSn4Pg5jOaN54Kiv1osW3TM6D3SvZ53Xk9-Y,13782
71
- pyeasyphd/tools/search/search_keywords.py,sha256=O_ivQzElsjujTHqU0Sxw4w4v3VwcN560HcoBhS1B3WA,10430
72
- pyeasyphd/tools/search/search_writers.py,sha256=qP6UE_oK2LKriP7kfoDR4j8p7MlV09zdK7LnXHHB1_8,12564
73
- pyeasyphd/tools/search/utils.py,sha256=yLKrMmM2x-fHdm6P8haFZzagd9sLkViTdwJTHyGRgXY,6092
74
- pyeasyphd/tools/spider/process_spider_bib.py,sha256=p1UNUaLAxMZPYtuwjNi20e1ms--cyjlB7CIZFP3SX6U,10443
75
- pyeasyphd/tools/spider/process_spider_url.py,sha256=XkMk6nqgYdc1WhWU03hWjBXnewxiCG21BF-I2qcFMn8,3014
76
- pyeasyphd/tools/spider/process_spider_url_bib.py,sha256=1b0FnUlTt5BzaOqFZJmnY5gnAhdD4pbQolHR1e3wiyE,2705
77
- pyeasyphd/utils/utils.py,sha256=yuHy6D2mTsd2aAwNBSMC7CU4LV-MkWwzKeO_0Iehbyg,1655
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,,