pyformatjson 0.2.9__tar.gz → 0.3.1__tar.gz
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.
- {pyformatjson-0.2.9 → pyformatjson-0.3.1}/.github/workflows/release.yml +1 -1
- pyformatjson-0.3.1/.python-version +1 -0
- {pyformatjson-0.2.9 → pyformatjson-0.3.1}/PKG-INFO +3 -3
- {pyformatjson-0.2.9 → pyformatjson-0.3.1}/docs/requirements.txt +1 -0
- pyformatjson-0.2.9/pyformatjson.sublime-project → pyformatjson-0.3.1/main.sublime-project +10 -3
- {pyformatjson-0.2.9 → pyformatjson-0.3.1}/pyformatjson/core/_base.py +2 -2
- {pyformatjson-0.2.9 → pyformatjson-0.3.1}/pyformatjson/core/update_json.py +33 -0
- {pyformatjson-0.2.9 → pyformatjson-0.3.1}/pyformatjson/tools/generate_dict.py +27 -8
- {pyformatjson-0.2.9 → pyformatjson-0.3.1}/pyproject.toml +2 -2
- {pyformatjson-0.2.9 → pyformatjson-0.3.1}/scripts/generate_docs.py +2 -1
- pyformatjson-0.3.1/tests/test_main.py +18 -0
- {pyformatjson-0.2.9 → pyformatjson-0.3.1}/.github/workflows/docs.yml +0 -0
- {pyformatjson-0.2.9 → pyformatjson-0.3.1}/.github/workflows/publish.yml +0 -0
- {pyformatjson-0.2.9 → pyformatjson-0.3.1}/.gitignore +0 -0
- {pyformatjson-0.2.9 → pyformatjson-0.3.1}/CODE_OF_CONDUCT.md +0 -0
- {pyformatjson-0.2.9 → pyformatjson-0.3.1}/LICENSE +0 -0
- {pyformatjson-0.2.9 → pyformatjson-0.3.1}/README.md +0 -0
- {pyformatjson-0.2.9 → pyformatjson-0.3.1}/docs/api-manual/index.md +0 -0
- {pyformatjson-0.2.9 → pyformatjson-0.3.1}/docs/index.md +0 -0
- {pyformatjson-0.2.9 → pyformatjson-0.3.1}/docs/users-guide/bug-report.md +0 -0
- {pyformatjson-0.2.9 → pyformatjson-0.3.1}/docs/users-guide/installation.md +0 -0
- {pyformatjson-0.2.9 → pyformatjson-0.3.1}/docs/users-guide/pull-request.md +0 -0
- {pyformatjson-0.2.9 → pyformatjson-0.3.1}/mkdocs.yml +0 -0
- {pyformatjson-0.2.9 → pyformatjson-0.3.1}/pyformatjson/__init__.py +0 -0
- {pyformatjson-0.2.9 → pyformatjson-0.3.1}/pyformatjson/core/__init__.py +0 -0
- {pyformatjson-0.2.9 → pyformatjson-0.3.1}/pyformatjson/main.py +0 -0
- {pyformatjson-0.2.9 → pyformatjson-0.3.1}/pyformatjson/tools/__init__.py +0 -0
- {pyformatjson-0.2.9 → pyformatjson-0.3.1}/pyformatjson/tools/write_dict.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.12
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: pyformatjson
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.3.1
|
|
4
4
|
Summary: pyformatjson
|
|
5
5
|
Project-URL: Homepage, https://github.com/Easy-PhD/pyformatjson
|
|
6
6
|
Project-URL: Repository, https://github.com/Easy-PhD/pyformatjson
|
|
@@ -26,7 +26,7 @@ Requires-Dist: func-timeout>=4.3.5
|
|
|
26
26
|
Requires-Dist: lxml>=6.0.2
|
|
27
27
|
Requires-Dist: playwright>=1.55.0
|
|
28
28
|
Requires-Dist: psutil>=7.1.2
|
|
29
|
-
Requires-Dist: pyadvtools>=0.3.
|
|
29
|
+
Requires-Dist: pyadvtools>=0.3.10
|
|
30
30
|
Requires-Dist: requests>=2.32.5
|
|
31
31
|
Requires-Dist: selenium>=4.38.0
|
|
32
32
|
Description-Content-Type: text/markdown
|
|
@@ -8,6 +8,15 @@
|
|
|
8
8
|
"target": "terminus_exec",
|
|
9
9
|
"cancel": "terminus_cancel_build",
|
|
10
10
|
"shell_cmd": "\".venv/bin/python3\" -u \"$file\"",
|
|
11
|
+
"windows": {
|
|
12
|
+
"shell_cmd": "\".venv\\Scripts\\python.exe\" -u \"$file\"",
|
|
13
|
+
},
|
|
14
|
+
"osx": {
|
|
15
|
+
"shell_cmd": "\".venv/bin/python3\" -u \"$file\"",
|
|
16
|
+
},
|
|
17
|
+
"linux": {
|
|
18
|
+
"shell_cmd": "\".venv/bin/python3\" -u \"$file\"",
|
|
19
|
+
},
|
|
11
20
|
"env": {
|
|
12
21
|
"PYTHONIOENCODING": "utf-8",
|
|
13
22
|
"PYTHONPATH": ".",
|
|
@@ -17,8 +26,6 @@
|
|
|
17
26
|
],
|
|
18
27
|
"settings": {},
|
|
19
28
|
"folders": [
|
|
20
|
-
{
|
|
21
|
-
"path": ".",
|
|
22
|
-
},
|
|
29
|
+
{ "path": ".", },
|
|
23
30
|
],
|
|
24
31
|
}
|
|
@@ -69,8 +69,8 @@ def split_data_list(split_pattern: str, data_list: list[str], last_next: str = "
|
|
|
69
69
|
new_data_list = []
|
|
70
70
|
for line in data_list:
|
|
71
71
|
split_list = re.split(split_pattern, line)
|
|
72
|
-
list_one = split_list[0: len(split_list): 2]
|
|
73
|
-
list_two = split_list[1: len(split_list): 2]
|
|
72
|
+
list_one = split_list[0 : len(split_list) : 2]
|
|
73
|
+
list_two = split_list[1 : len(split_list) : 2]
|
|
74
74
|
|
|
75
75
|
temp = []
|
|
76
76
|
if last_next == "next":
|
|
@@ -63,12 +63,45 @@ def update_json_file(full_json_cj: str, conferences_or_journals: str) -> dict[st
|
|
|
63
63
|
|
|
64
64
|
# Save updated JSON
|
|
65
65
|
if flag and json_dict:
|
|
66
|
+
json_dict = add_multiple_add(json_dict, conferences_or_journals)
|
|
67
|
+
|
|
66
68
|
with open(full_json_cj, "w", encoding="utf-8", newline="\n") as f:
|
|
67
69
|
f.write(json.dumps(json_dict, indent=4, sort_keys=True, ensure_ascii=True))
|
|
68
70
|
|
|
69
71
|
return json_dict
|
|
70
72
|
|
|
71
73
|
|
|
74
|
+
def add_multiple_add(json_dict, conferences_or_journals):
|
|
75
|
+
for pub in json_dict:
|
|
76
|
+
for key in json_dict[pub][conferences_or_journals]:
|
|
77
|
+
names_abbr = json_dict[pub][conferences_or_journals][key].get("names_abbr", [])
|
|
78
|
+
names_full = json_dict[pub][conferences_or_journals][key].get("names_full", [])
|
|
79
|
+
|
|
80
|
+
names_abbr_, names_full_ = [], []
|
|
81
|
+
for abbr, full in zip(names_abbr, names_full, strict=True):
|
|
82
|
+
names_abbr_.append(abbr)
|
|
83
|
+
names_full_.append(full)
|
|
84
|
+
|
|
85
|
+
full = full.encode('unicode_escape').decode()
|
|
86
|
+
if "&" in full and r"\\&" not in full and r"\\\\&" not in full:
|
|
87
|
+
full_1 = re.sub("&", r"\\&", full)
|
|
88
|
+
full_2 = re.sub("&", r"\\\\&", full)
|
|
89
|
+
if full_1 not in names_full:
|
|
90
|
+
breakpoint()
|
|
91
|
+
names_abbr_.append(abbr)
|
|
92
|
+
names_full_.append(full_1)
|
|
93
|
+
|
|
94
|
+
if full_2 not in names_full:
|
|
95
|
+
breakpoint()
|
|
96
|
+
names_abbr_.append(abbr)
|
|
97
|
+
names_full_.append(full_2)
|
|
98
|
+
|
|
99
|
+
json_dict[pub][conferences_or_journals][key]["names_abbr"] = names_abbr_
|
|
100
|
+
json_dict[pub][conferences_or_journals][key]["names_full"] = names_full_
|
|
101
|
+
|
|
102
|
+
return json_dict
|
|
103
|
+
|
|
104
|
+
|
|
72
105
|
def generate_standard_form(json_dict: dict[str, Any], conferences_or_journals: str):
|
|
73
106
|
# Check for duplicate abbreviations in the data.
|
|
74
107
|
abbr_list = []
|
|
@@ -469,12 +469,18 @@ class GenerateDataDict:
|
|
|
469
469
|
# Parse abstract due date
|
|
470
470
|
abstract_due = None
|
|
471
471
|
if due_str := abbr_dict.get("conf_abstract_due", "").strip():
|
|
472
|
-
|
|
472
|
+
if due_str.upper() == "TBD":
|
|
473
|
+
abstract_due = "TBD"
|
|
474
|
+
else:
|
|
475
|
+
abstract_due = datetime.strptime(due_str, "%d/%m/%Y").date()
|
|
473
476
|
|
|
474
477
|
# Parse conference start date
|
|
475
478
|
start_date = None
|
|
476
479
|
if start_str := abbr_dict.get("conf_date_start", "").strip():
|
|
477
|
-
|
|
480
|
+
if start_str.upper() == "TBD":
|
|
481
|
+
start_date = "TBD"
|
|
482
|
+
else:
|
|
483
|
+
start_date = datetime.strptime(start_str, "%d/%m/%Y").date()
|
|
478
484
|
|
|
479
485
|
# Get today's date
|
|
480
486
|
today = datetime.strptime(datetime.now().strftime("%d/%m/%Y"), "%d/%m/%Y").date()
|
|
@@ -487,15 +493,15 @@ class GenerateDataDict:
|
|
|
487
493
|
|
|
488
494
|
if self.for_vue:
|
|
489
495
|
# Vue.js template format
|
|
490
|
-
if abstract_due:
|
|
496
|
+
if (abstract_due is not None) and (abstract_due != "TBD"):
|
|
491
497
|
abstract_indicator = f"**{{{{ diffDate('{abstract_due}') }}}}**"
|
|
492
|
-
if start_date:
|
|
498
|
+
if (start_date is not None) and (abstract_due != "TBD"):
|
|
493
499
|
start_indicator = f"**{{{{ diffDate('{start_date}') }}}}**"
|
|
494
500
|
else:
|
|
495
501
|
# Standard day count format
|
|
496
|
-
if abstract_due:
|
|
502
|
+
if (abstract_due is not None) and (abstract_due != "TBD"):
|
|
497
503
|
abstract_indicator = (abstract_due - today).days if today <= abstract_due else "Expired"
|
|
498
|
-
if start_date:
|
|
504
|
+
if (start_date is not None) and (abstract_due != "TBD"):
|
|
499
505
|
start_indicator = (start_date - today).days if today <= start_date else "Expired"
|
|
500
506
|
|
|
501
507
|
return abstract_indicator, start_indicator
|
|
@@ -520,8 +526,21 @@ class GenerateDataDict:
|
|
|
520
526
|
) -> str:
|
|
521
527
|
"""Construct conference table row string."""
|
|
522
528
|
# Format date strings
|
|
523
|
-
|
|
524
|
-
|
|
529
|
+
if abstract_due is None:
|
|
530
|
+
abstract_date_str = ""
|
|
531
|
+
else:
|
|
532
|
+
if abstract_due == "TBD":
|
|
533
|
+
abstract_date_str = "TBD"
|
|
534
|
+
else:
|
|
535
|
+
abstract_date_str = abstract_due.strftime("%d/%m/%Y")
|
|
536
|
+
|
|
537
|
+
if start_date is None:
|
|
538
|
+
start_date_str = ""
|
|
539
|
+
else:
|
|
540
|
+
if start_date == "TBD":
|
|
541
|
+
start_date_str = "TBD"
|
|
542
|
+
else:
|
|
543
|
+
start_date_str = start_date.strftime("%d/%m/%Y")
|
|
525
544
|
|
|
526
545
|
# Format start date with link if available
|
|
527
546
|
start_date_display = self._format_link(start_date_str, year_url) if start_date_str else ""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "pyformatjson"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.3.1"
|
|
4
4
|
description = "pyformatjson"
|
|
5
5
|
license = "GPL-3.0-or-later"
|
|
6
6
|
license-files = ["LICENSE"]
|
|
@@ -28,7 +28,7 @@ dependencies = [
|
|
|
28
28
|
"lxml>=6.0.2",
|
|
29
29
|
"playwright>=1.55.0",
|
|
30
30
|
"psutil>=7.1.2",
|
|
31
|
-
"pyadvtools>=0.3.
|
|
31
|
+
"pyadvtools>=0.3.10",
|
|
32
32
|
"requests>=2.32.5",
|
|
33
33
|
"selenium>=4.38.0",
|
|
34
34
|
]
|
|
@@ -35,7 +35,8 @@ class DocGenerator:
|
|
|
35
35
|
def get_module_info(self, module_path: Path) -> dict[str, Any]:
|
|
36
36
|
# Calculate relative import path
|
|
37
37
|
relative_path = module_path.relative_to(self.source_dir)
|
|
38
|
-
module_name = str(relative_path).replace("/", ".").replace("\\", ".")
|
|
38
|
+
module_name = str(relative_path).replace("/", ".").replace("\\", ".")
|
|
39
|
+
module_name = module_name[:-3] # replace(".py", "")
|
|
39
40
|
|
|
40
41
|
return {
|
|
41
42
|
"path": module_path,
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
from pyformatjson.main import main_generate_md_files
|
|
4
|
+
|
|
5
|
+
if __name__ == "__main__":
|
|
6
|
+
full_json_c = os.getenv("FULL_JSON_C", "")
|
|
7
|
+
full_json_j = os.getenv("FULL_JSON_J", "")
|
|
8
|
+
full_json_k = os.getenv("FULL_JSON_K", "")
|
|
9
|
+
path_spidered_bibs = os.getenv("PATH_SPIDERED_BIBS", "")
|
|
10
|
+
path_output = os.path.join(os.getenv("PATH_AILINKS", ""), "docs", "data")
|
|
11
|
+
|
|
12
|
+
main_generate_md_files(full_json_c, full_json_j, full_json_k, path_output, path_spidered_bibs)
|
|
13
|
+
main_generate_md_files(
|
|
14
|
+
full_json_c, full_json_j, full_json_k, path_output, path_spidered_bibs, keywords_category_name="S"
|
|
15
|
+
)
|
|
16
|
+
main_generate_md_files(
|
|
17
|
+
full_json_c, full_json_j, full_json_k, path_output, path_spidered_bibs, keywords_category_name="Y"
|
|
18
|
+
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|