commonmeta-py 0.74__py3-none-any.whl → 0.75__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.
- commonmeta/__init__.py +1 -1
- commonmeta/utils.py +24 -4
- {commonmeta_py-0.74.dist-info → commonmeta_py-0.75.dist-info}/METADATA +1 -1
- {commonmeta_py-0.74.dist-info → commonmeta_py-0.75.dist-info}/RECORD +7 -7
- {commonmeta_py-0.74.dist-info → commonmeta_py-0.75.dist-info}/WHEEL +0 -0
- {commonmeta_py-0.74.dist-info → commonmeta_py-0.75.dist-info}/entry_points.txt +0 -0
- {commonmeta_py-0.74.dist-info → commonmeta_py-0.75.dist-info}/licenses/LICENSE +0 -0
commonmeta/__init__.py
CHANGED
commonmeta/utils.py
CHANGED
@@ -1116,16 +1116,33 @@ def extract_curie(string: Optional[str]) -> Optional[str]:
|
|
1116
1116
|
"""Extract CURIE"""
|
1117
1117
|
if string is None:
|
1118
1118
|
return None
|
1119
|
-
match = re.search(
|
1119
|
+
match = re.search(
|
1120
|
+
r"((?:doi|DOI):\s?([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-]))", string
|
1121
|
+
)
|
1120
1122
|
if match is None:
|
1121
1123
|
return None
|
1122
1124
|
return doi_as_url(match.group(2))
|
1123
1125
|
|
1124
|
-
|
1126
|
+
|
1127
|
+
def replace_curie(string: Optional[str]) -> Optional[str]:
|
1128
|
+
"""Replace CURIE with DOI expressed as URL"""
|
1129
|
+
if string is None:
|
1130
|
+
return None
|
1131
|
+
match = re.sub(
|
1132
|
+
r"((?:doi|DOI):\s?([\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-]))", r'https://doi.org/\2', string
|
1133
|
+
)
|
1134
|
+
if match is None:
|
1135
|
+
return None
|
1136
|
+
return match
|
1137
|
+
|
1138
|
+
|
1125
1139
|
def extract_url(string: str) -> list:
|
1126
1140
|
"""Extract urls from string, including markdown and html."""
|
1127
1141
|
|
1128
|
-
match = re.search(
|
1142
|
+
match = re.search(
|
1143
|
+
r"((?:http|https):\/\/(?:[\w_-]+(?:(?:\.[\w_-]+)+))(?:[\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-]))",
|
1144
|
+
string,
|
1145
|
+
)
|
1129
1146
|
if match is None:
|
1130
1147
|
return None
|
1131
1148
|
return normalize_url(match.group(1))
|
@@ -1134,7 +1151,10 @@ def extract_url(string: str) -> list:
|
|
1134
1151
|
def extract_urls(string: str) -> list:
|
1135
1152
|
"""Extract urls from string, including markdown and html."""
|
1136
1153
|
|
1137
|
-
urls = re.findall(
|
1154
|
+
urls = re.findall(
|
1155
|
+
r"((?:http|https):\/\/(?:[\w_-]+(?:(?:\.[\w_-]+)+))(?:[\w.,@?^=%&:\/~+#-]*[\w@?^=%&\/~+#-]))",
|
1156
|
+
string,
|
1157
|
+
)
|
1138
1158
|
return py_.uniq(urls)
|
1139
1159
|
|
1140
1160
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: commonmeta-py
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.75
|
4
4
|
Summary: Library for conversions to/from the Commonmeta scholarly metadata format
|
5
5
|
Project-URL: Homepage, https://python.commonmeta.org
|
6
6
|
Project-URL: Repository, https://github.com/front-matter/commonmeta-py
|
@@ -1,4 +1,4 @@
|
|
1
|
-
commonmeta/__init__.py,sha256=
|
1
|
+
commonmeta/__init__.py,sha256=lNosYNS7L7Rqp2snKZHwRszSyam6_9kZyO0dR0PeyVg,1875
|
2
2
|
commonmeta/api_utils.py,sha256=-ZHGVZZhJqnjnsLtp4-PoeHYbDqL0cQme7W70BEjo4U,2677
|
3
3
|
commonmeta/author_utils.py,sha256=zBIPTgP5n7Zx57xomJ2h7x0dvC0AV8gJ2gPoYeDy5Lo,8348
|
4
4
|
commonmeta/base_utils.py,sha256=AsUElA5kT2fw_Osy7Uaj2F6MKeq9yB7d5f2V-h2lh7c,3750
|
@@ -10,7 +10,7 @@ commonmeta/doi_utils.py,sha256=s2J95V9rWPbGsh5oNXht3yJkJ0NmVLRlOXDPXjnN-Ck,9152
|
|
10
10
|
commonmeta/metadata.py,sha256=cjvCcxW1FMtKCbNKan0zXX0FN6z5orHFGPYsgkp6fSI,12480
|
11
11
|
commonmeta/schema_utils.py,sha256=gg3l1jd_lFtRkQlO1DYGMVbC10nEmVTN4AWacxC4AAE,915
|
12
12
|
commonmeta/translators.py,sha256=RpGJtKNLjmz41VREZDY7KyyE2eXOi8j7m-da4jHmknI,1362
|
13
|
-
commonmeta/utils.py,sha256=
|
13
|
+
commonmeta/utils.py,sha256=nWSdkc1jNkhSnv46MKScExOUlD--wMP_QCRpy8Rnq_g,44989
|
14
14
|
commonmeta/readers/__init__.py,sha256=vOf7UsOKNoh_ZCuyexxhAmPMt8wjB-pF_CfpWRaN8pk,45
|
15
15
|
commonmeta/readers/bibtex_reader.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
16
16
|
commonmeta/readers/cff_reader.py,sha256=5HMFUvjE1zb-zfpQSNM8vtB0YunD0reom99hn8N0xKc,6144
|
@@ -69,8 +69,8 @@ commonmeta/writers/datacite_writer.py,sha256=UpDp4Brg5xrmS5T3QYoNi6PPXKdRxAo254e
|
|
69
69
|
commonmeta/writers/inveniordm_writer.py,sha256=TctfZsiB8aiXWDLijJpxjMM77aKY6-hgKeAPDMfZoh4,11438
|
70
70
|
commonmeta/writers/ris_writer.py,sha256=AcnCszS3WY9lF594NbFBtLylsA8ownnYp_XLQJ84Ios,2093
|
71
71
|
commonmeta/writers/schema_org_writer.py,sha256=5j002uCNLdlScZMNQmPjodcVWqaBh2z38zL1H4lo2hY,5741
|
72
|
-
commonmeta_py-0.
|
73
|
-
commonmeta_py-0.
|
74
|
-
commonmeta_py-0.
|
75
|
-
commonmeta_py-0.
|
76
|
-
commonmeta_py-0.
|
72
|
+
commonmeta_py-0.75.dist-info/METADATA,sha256=mBeKmlKrFby8FJHM4SPhzxQP6epxsD9B4al_pSUewPA,7731
|
73
|
+
commonmeta_py-0.75.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
74
|
+
commonmeta_py-0.75.dist-info/entry_points.txt,sha256=U4w4BoRuS3rN5t5Y-uYSyOeU5Lh_VRVMS9OIDzIgw4w,50
|
75
|
+
commonmeta_py-0.75.dist-info/licenses/LICENSE,sha256=746hEF2wZCKkcckk5-_DcBLtHewfaEMS4iXTlA1PVwk,1074
|
76
|
+
commonmeta_py-0.75.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|