commonmeta-py 0.41__py3-none-any.whl → 0.43__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/constants.py +2 -0
- commonmeta/crossref_utils.py +7 -9
- commonmeta/readers/json_feed_reader.py +23 -16
- commonmeta/resources/commonmeta_v0.15.json +1 -0
- commonmeta/writers/inveniordm_writer.py +8 -2
- {commonmeta_py-0.41.dist-info → commonmeta_py-0.43.dist-info}/METADATA +1 -1
- {commonmeta_py-0.41.dist-info → commonmeta_py-0.43.dist-info}/RECORD +11 -11
- {commonmeta_py-0.41.dist-info → commonmeta_py-0.43.dist-info}/LICENSE +0 -0
- {commonmeta_py-0.41.dist-info → commonmeta_py-0.43.dist-info}/WHEEL +0 -0
- {commonmeta_py-0.41.dist-info → commonmeta_py-0.43.dist-info}/entry_points.txt +0 -0
commonmeta/__init__.py
CHANGED
commonmeta/constants.py
CHANGED
commonmeta/crossref_utils.py
CHANGED
@@ -363,10 +363,12 @@ def insert_funding_references(metadata, xml):
|
|
363
363
|
)
|
364
364
|
if funding_reference.get("funderIdentifier", None) is not None:
|
365
365
|
funder_identifier = funding_reference.get("funderIdentifier", None)
|
366
|
-
|
366
|
+
|
367
367
|
# translate ROR to Crossref funder ID until Crossref supports ROR
|
368
|
-
funder_identifier = ROR_TO_CROSSREF_FUNDER_ID_TRANSLATIONS.get(
|
369
|
-
|
368
|
+
funder_identifier = ROR_TO_CROSSREF_FUNDER_ID_TRANSLATIONS.get(
|
369
|
+
funder_identifier, funder_identifier
|
370
|
+
)
|
371
|
+
|
370
372
|
etree.SubElement(
|
371
373
|
funder_name,
|
372
374
|
"assertion",
|
@@ -447,9 +449,7 @@ def insert_item_number(metadata, xml):
|
|
447
449
|
if metadata.identifiers is None:
|
448
450
|
return xml
|
449
451
|
for identifier in metadata.identifiers:
|
450
|
-
if identifier.get("
|
451
|
-
continue
|
452
|
-
if identifier.get("identifierType", None) is not None:
|
452
|
+
if identifier.get("identifierType", None) == "UUID":
|
453
453
|
# strip hyphen from UUIDs, as item_number can only be 32 characters long (UUIDv4 is 36 characters long)
|
454
454
|
if identifier.get("identifierType", None) == "UUID":
|
455
455
|
identifier["identifier"] = identifier.get("identifier", "").replace(
|
@@ -461,9 +461,7 @@ def insert_item_number(metadata, xml):
|
|
461
461
|
{"item_number_type": identifier.get("identifierType", "").lower()},
|
462
462
|
).text = identifier.get("identifier", None)
|
463
463
|
else:
|
464
|
-
|
465
|
-
"identifier", None
|
466
|
-
)
|
464
|
+
continue
|
467
465
|
return xml
|
468
466
|
|
469
467
|
|
@@ -127,7 +127,10 @@ def read_json_feed_item(data: Optional[dict], **kwargs) -> Commonmeta:
|
|
127
127
|
"type": "IsPartOf",
|
128
128
|
}
|
129
129
|
)
|
130
|
-
identifiers = [
|
130
|
+
identifiers = [
|
131
|
+
{"identifier": meta.get("id"), "identifierType": "UUID"},
|
132
|
+
{"identifier": meta.get("guid"), "identifierType": "GUID"},
|
133
|
+
]
|
131
134
|
files = get_files(_id)
|
132
135
|
state = "findable" if meta or read_options else "not_found"
|
133
136
|
|
@@ -237,13 +240,15 @@ def get_funding_references(meta: Optional[dict]) -> Optional[list]:
|
|
237
240
|
else:
|
238
241
|
award_number = f.path.segments[-1]
|
239
242
|
return [
|
240
|
-
compact(
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
243
|
+
compact(
|
244
|
+
{
|
245
|
+
"funderName": funder_name,
|
246
|
+
"funderIdentifier": urls[0],
|
247
|
+
"funderIdentifierType": "Crossref Funder ID",
|
248
|
+
"awardUri": urls[1],
|
249
|
+
"awardNumber": award_number,
|
250
|
+
}
|
251
|
+
)
|
247
252
|
]
|
248
253
|
# URL is ROR ID for funder.
|
249
254
|
elif len(urls) == 2 and validate_ror(urls[0]):
|
@@ -254,7 +259,7 @@ def get_funding_references(meta: Optional[dict]) -> Optional[list]:
|
|
254
259
|
funder_name = ror.get("name", None)
|
255
260
|
funder_identifier = urls[0]
|
256
261
|
funder_identifier_type = "ROR"
|
257
|
-
|
262
|
+
|
258
263
|
f = furl(urls[1])
|
259
264
|
# url is for NSF grant
|
260
265
|
if f.args["awd_id"] is not None:
|
@@ -263,13 +268,15 @@ def get_funding_references(meta: Optional[dict]) -> Optional[list]:
|
|
263
268
|
award_number = f.path.segments[-1]
|
264
269
|
return [
|
265
270
|
compact(
|
266
|
-
compact(
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
|
271
|
+
compact(
|
272
|
+
{
|
273
|
+
"funderName": funder_name,
|
274
|
+
"funderIdentifier": funder_identifier,
|
275
|
+
"funderIdentifierType": funder_identifier_type,
|
276
|
+
"awardUri": urls[1],
|
277
|
+
"awardNumber": award_number,
|
278
|
+
}
|
279
|
+
)
|
273
280
|
)
|
274
281
|
]
|
275
282
|
|
@@ -16,7 +16,6 @@ from ..utils import (
|
|
16
16
|
get_language,
|
17
17
|
validate_orcid,
|
18
18
|
id_from_url,
|
19
|
-
issn_from_url,
|
20
19
|
FOS_MAPPINGS,
|
21
20
|
)
|
22
21
|
|
@@ -39,8 +38,15 @@ def write_inveniordm(metadata):
|
|
39
38
|
),
|
40
39
|
}
|
41
40
|
for i in wrap(metadata.identifiers)
|
42
|
-
if i.get("
|
41
|
+
if i.get("identifier", None) != metadata.id
|
43
42
|
]
|
43
|
+
identifiers.append(
|
44
|
+
{
|
45
|
+
"identifier": metadata.url,
|
46
|
+
"scheme": "url",
|
47
|
+
}
|
48
|
+
)
|
49
|
+
print(identifiers, metadata.id)
|
44
50
|
references = [
|
45
51
|
to_inveniordm_related_identifier(i)
|
46
52
|
for i in wrap(metadata.references)
|
@@ -1,10 +1,10 @@
|
|
1
|
-
commonmeta/__init__.py,sha256=
|
1
|
+
commonmeta/__init__.py,sha256=NCfJkV3RLYOmc-5gvHB0TQGeQ0urx1iJfNc23cL9vs0,1779
|
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=0t6fr9XGeeTBoMlKSAMI7p_EmKsA6wYRW0roEBXVcc8,3722
|
5
5
|
commonmeta/cli.py,sha256=0IJF1SQ1sKPg7M0Gb8fpX2nBps-G0L13o01__M6c5Z0,6104
|
6
|
-
commonmeta/constants.py,sha256=
|
7
|
-
commonmeta/crossref_utils.py,sha256=
|
6
|
+
commonmeta/constants.py,sha256=VfjXLkwoV4A5uztH3vgDJ_qrt7PaWGO6QtHbAt4r03c,17501
|
7
|
+
commonmeta/crossref_utils.py,sha256=qJlTZtfKR2shAXQDm8VBYUujKFkTtZTUz19GuMUANaI,22198
|
8
8
|
commonmeta/date_utils.py,sha256=amF3E0ZJlh8yY5eY3aVXQyAO1x2WuZHJXw-ajOEcdUQ,5808
|
9
9
|
commonmeta/doi_utils.py,sha256=Dt6K9ADD2ga2WNsOzfX9f29gnubhn7xqeKL7U5pEpBs,8209
|
10
10
|
commonmeta/metadata.py,sha256=dqqk4IW-_OwtS_PVs0i7AuxrkNqOYjJCqhQJ2X-I1DQ,12398
|
@@ -19,7 +19,7 @@ commonmeta/readers/csl_reader.py,sha256=5V_sHSJwcAWJmhB8SYk199nB96BWYX1Sq9vkQ3iE
|
|
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=_DZGEfFGrrooUjA-SNYg1WKJKdV6nA4Ez3HSswvQ6qs,13237
|
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=xyWzO2XAWlI2pYVl2EbVRsUmfiWXEwP64CHRBQNRN-M,16835
|
@@ -27,7 +27,7 @@ commonmeta/resources/cff_v1.2.0.json,sha256=MpfjDYgX7fN9PLiG54ISZ2uu9WItNqfh-yaR
|
|
27
27
|
commonmeta/resources/commonmeta_v0.12.json,sha256=HUSNReXh2JN3Q6YWSt7CE69js8dh50OlpMYGTyU98oU,16762
|
28
28
|
commonmeta/resources/commonmeta_v0.13.json,sha256=2-WSZGijR13zVu97S_YHXr-cyeLW7hzHXYMlr6nIjdw,15787
|
29
29
|
commonmeta/resources/commonmeta_v0.14.json,sha256=nACmkTe4IrZkygd5AeJnAv9P4EWfzCwW9oL5AhubvnE,17657
|
30
|
-
commonmeta/resources/commonmeta_v0.15.json,sha256=
|
30
|
+
commonmeta/resources/commonmeta_v0.15.json,sha256=dZsWu7DOHL04v1tYAX1RE4Kyn_mt0HnJvEZRKvc8w0A,17733
|
31
31
|
commonmeta/resources/crossref/AccessIndicators.xsd,sha256=en-G2FFt4ewIFRw5C6g4YA8Nc0M66fCM2CygiO_ZqqY,2825
|
32
32
|
commonmeta/resources/crossref/JATS-journalpublishing1-3d2-mathml3-elements.xsd,sha256=l5jJMFm4xx09bavH2Gc3EqIdr-0PTf6M9YBTNpUaZhY,415409
|
33
33
|
commonmeta/resources/crossref/JATS-journalpublishing1-3d2-mathml3.xsd,sha256=goO2ckm12fF2-kGFZC_FaTBdi4BK3YCRwb_ESur8dfY,2210
|
@@ -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=rlCeShkvC6ui9By0yVfNCMay_JfaZ4AooUPOPg-g-2M,2819
|
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=-rMdMBgS5oGvr0aNG15wI7z3pML42kHTLzK7pNBjqlc,9579
|
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.43.dist-info/LICENSE,sha256=746hEF2wZCKkcckk5-_DcBLtHewfaEMS4iXTlA1PVwk,1074
|
73
|
+
commonmeta_py-0.43.dist-info/METADATA,sha256=gGmAbzAdyMfGMk-7DmXUtgakUBue38wc6qryVTjen1o,8331
|
74
|
+
commonmeta_py-0.43.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
75
|
+
commonmeta_py-0.43.dist-info/entry_points.txt,sha256=vbcDw3_2lMTKdcAL2VUF4DRYRpKuzXVYLMCdgKVf88U,49
|
76
|
+
commonmeta_py-0.43.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|