commonmeta-py 0.66__py3-none-any.whl → 0.68__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/readers/json_feed_reader.py +11 -22
- commonmeta/writers/inveniordm_writer.py +2 -2
- {commonmeta_py-0.66.dist-info → commonmeta_py-0.68.dist-info}/METADATA +1 -1
- {commonmeta_py-0.66.dist-info → commonmeta_py-0.68.dist-info}/RECORD +8 -8
- {commonmeta_py-0.66.dist-info → commonmeta_py-0.68.dist-info}/LICENSE +0 -0
- {commonmeta_py-0.66.dist-info → commonmeta_py-0.68.dist-info}/WHEEL +0 -0
- {commonmeta_py-0.66.dist-info → commonmeta_py-0.68.dist-info}/entry_points.txt +0 -0
commonmeta/__init__.py
CHANGED
@@ -182,36 +182,25 @@ def get_references(references: list) -> list:
|
|
182
182
|
|
183
183
|
if reference.get("id", None) and validate_doi(reference.get("id")):
|
184
184
|
id_ = normalize_doi(reference.get("id"))
|
185
|
-
return compact(
|
186
|
-
{
|
187
|
-
"id": id_,
|
188
|
-
"key": reference.get("key", None),
|
189
|
-
"title": reference.get("title", None),
|
190
|
-
"publicationYear": reference.get("publicationYear", None),
|
191
|
-
"unstructured": reference.get("unstructured", None),
|
192
|
-
}
|
193
|
-
)
|
194
|
-
|
195
185
|
else:
|
196
186
|
id_ = normalize_url(reference.get("id", None))
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
)
|
187
|
+
|
188
|
+
return compact(
|
189
|
+
{
|
190
|
+
"id": id_,
|
191
|
+
"key": reference.get("key", None),
|
192
|
+
"title": reference.get("title", None),
|
193
|
+
"publicationYear": reference.get("publicationYear", None),
|
194
|
+
"unstructured": reference.get("unstructured", None),
|
195
|
+
}
|
196
|
+
)
|
208
197
|
|
209
198
|
def number_reference(reference: dict, index: int) -> dict:
|
210
199
|
"""number reference"""
|
211
200
|
reference["key"] = f"ref{index + 1}"
|
212
201
|
return reference
|
213
202
|
|
214
|
-
references = [get_reference(i) for i in references
|
203
|
+
references = [get_reference(i) for i in references]
|
215
204
|
return [
|
216
205
|
number_reference(i, index)
|
217
206
|
for index, i in enumerate(references)
|
@@ -283,9 +283,9 @@ def to_inveniordm_reference(reference: dict) -> dict:
|
|
283
283
|
# remove optional trailing period
|
284
284
|
unstructured = unstructured.rstrip(" .")
|
285
285
|
|
286
|
-
if
|
286
|
+
if identifier:
|
287
287
|
# remove duplicate ID from unstructured reference
|
288
|
-
unstructured = unstructured.replace(
|
288
|
+
unstructured = unstructured.replace(identifier, "")
|
289
289
|
|
290
290
|
return compact(
|
291
291
|
{
|
@@ -1,4 +1,4 @@
|
|
1
|
-
commonmeta/__init__.py,sha256=
|
1
|
+
commonmeta/__init__.py,sha256=adfgHsyzi0gQOYNT67ZTxtK5voYo3ROIL01tYfMCFKA,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
|
@@ -19,7 +19,7 @@ commonmeta/readers/csl_reader.py,sha256=IO8uj-L_BzPFWgfRzYCF9VbK5rBPBzDqak7iBELg
|
|
19
19
|
commonmeta/readers/datacite_reader.py,sha256=CdOtxhthrakBoQMsLTdPx6sUCmqtEWo5ICYE6ZsWDdo,12026
|
20
20
|
commonmeta/readers/datacite_xml_reader.py,sha256=nhnO92fZihr1HZlbXjyem-HJXc9_DWLgJ2zeltuPMIg,13041
|
21
21
|
commonmeta/readers/inveniordm_reader.py,sha256=jzv0rXzT8OCdPD_MShBXTnlwD-F9tpTX7OKZGn8smzs,7480
|
22
|
-
commonmeta/readers/json_feed_reader.py,sha256=
|
22
|
+
commonmeta/readers/json_feed_reader.py,sha256=G1q-Oq9keqBZYsWKtVE8EWr4rgQQYrNLMqKA7MSYXMg,13698
|
23
23
|
commonmeta/readers/kbase_reader.py,sha256=ehKXQsJyPCtaq2FmBxNb2Jb5Nktpx8pNscpmEM6N0A4,6763
|
24
24
|
commonmeta/readers/ris_reader.py,sha256=v6qOd-i2OcMTEFy5RGd3MlYthJcYSU6yzmZ5yHDzmII,3677
|
25
25
|
commonmeta/readers/schema_org_reader.py,sha256=udvRBeEnsyRmy5UOIk523f7x08RRLvxqTCMMS736oFs,17132
|
@@ -66,11 +66,11 @@ commonmeta/writers/commonmeta_writer.py,sha256=2qlttCfYpGhfVjrYkjzbIra7AywssRLT3
|
|
66
66
|
commonmeta/writers/crossref_xml_writer.py,sha256=0Ds494RnXfdfjWw5CLX1kwV2zP7gqffdVqO-X74Uc6c,492
|
67
67
|
commonmeta/writers/csl_writer.py,sha256=6N-93R1emcOsZrUTIhPBVd_Fv1C8Z5EAFYI0mYjoYaY,2797
|
68
68
|
commonmeta/writers/datacite_writer.py,sha256=G7Lr0aZ4sAEdbfXe3dG4Y6AyGUKA9UWr_iiaQRDnV24,6233
|
69
|
-
commonmeta/writers/inveniordm_writer.py,sha256=
|
69
|
+
commonmeta/writers/inveniordm_writer.py,sha256=UeVLLx1SUcEOxaYdvOv8NhdbpISVD4nb48dNgDKW7ws,11403
|
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.68.dist-info/LICENSE,sha256=746hEF2wZCKkcckk5-_DcBLtHewfaEMS4iXTlA1PVwk,1074
|
73
|
+
commonmeta_py-0.68.dist-info/METADATA,sha256=LyOalGljP9ZbkF4pQI8oV623Nq3pCMgJfM2KYKqWby8,8279
|
74
|
+
commonmeta_py-0.68.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
|
75
|
+
commonmeta_py-0.68.dist-info/entry_points.txt,sha256=vbcDw3_2lMTKdcAL2VUF4DRYRpKuzXVYLMCdgKVf88U,49
|
76
|
+
commonmeta_py-0.68.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|