commonmeta-py 0.88__py3-none-any.whl → 0.89__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 CHANGED
@@ -10,7 +10,7 @@ commonmeta-py is a Python library to convert scholarly metadata
10
10
  """
11
11
 
12
12
  __title__ = "commonmeta-py"
13
- __version__ = "0.88"
13
+ __version__ = "0.89"
14
14
  __author__ = "Martin Fenner"
15
15
  __license__ = "MIT"
16
16
 
@@ -11,6 +11,7 @@ from ..utils import (
11
11
  name_to_fos,
12
12
  from_inveniordm,
13
13
  get_language,
14
+ validate_ror,
14
15
  )
15
16
  from ..base_utils import compact, wrap, presence, sanitize
16
17
  from ..author_utils import get_authors
@@ -111,6 +112,7 @@ def read_inveniordm(data: dict, **kwargs) -> Commonmeta:
111
112
 
112
113
  references = get_references(wrap(py_.get(meta, "metadata.related_identifiers")))
113
114
  relations = get_relations(wrap(py_.get(meta, "metadata.related_identifiers")))
115
+ funding_references = get_funding_references(wrap(py_.get(meta, "metadata.funding")))
114
116
  if meta.get("conceptdoi", None):
115
117
  relations.append(
116
118
  {
@@ -138,7 +140,7 @@ def read_inveniordm(data: dict, **kwargs) -> Commonmeta:
138
140
  "license": presence(license_),
139
141
  "descriptions": descriptions,
140
142
  "geoLocations": None,
141
- # "funding_references": presence(meta.get("fundingReferences", None)),
143
+ "fundingReferences": presence(funding_references),
142
144
  "references": presence(references),
143
145
  "relations": presence(relations),
144
146
  # other properties
@@ -180,6 +182,23 @@ def get_references(references: list) -> list:
180
182
  return [map_reference(i) for i in references if is_reference(i)]
181
183
 
182
184
 
185
+ def get_funding_references(funding_references: list) -> list:
186
+ """get_funding_references"""
187
+
188
+ def map_funding(funding: dict) -> dict:
189
+ """map_funding"""
190
+
191
+ return compact({
192
+ "funderName": py_.get(funding, "funder.name"),
193
+ "funderIdentifier": py_.get(funding, "funder.id"),
194
+ "funderIdentifierType": "ROR" if validate_ror(py_.get(funding, "funder.id")) else None,
195
+ "awardTitle": py_.get(funding, "award.title.en"),
196
+ "awardNumber": py_.get(funding, "award.number"),
197
+ "awardUri": py_.get(funding, "award.identifiers[0].identifier"),
198
+ })
199
+
200
+ return [map_funding(i) for i in funding_references]
201
+
183
202
  def get_file(file: dict) -> str:
184
203
  """get_file"""
185
204
  _type = file.get("type", None)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: commonmeta-py
3
- Version: 0.88
3
+ Version: 0.89
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=ic4KBTzkTx4hqmZYxqszo6fFf7Fo-M-YJR4efJtxNEw,1911
1
+ commonmeta/__init__.py,sha256=UmlY6KWhmga2K4KGz6RomP17GxZSv1leFctEt3jMM8w,1911
2
2
  commonmeta/api_utils.py,sha256=-ZHGVZZhJqnjnsLtp4-PoeHYbDqL0cQme7W70BEjo4U,2677
3
3
  commonmeta/author_utils.py,sha256=1oQQfxaq7aMQI3rLt8XMufksuBeC8Zht96aJ8vz09Ug,8459
4
4
  commonmeta/base_utils.py,sha256=AsUElA5kT2fw_Osy7Uaj2F6MKeq9yB7d5f2V-h2lh7c,3750
@@ -21,7 +21,7 @@ commonmeta/readers/crossref_xml_reader.py,sha256=yZOh66_4tVS5i0TdEyOa48ckpl7_cj6
21
21
  commonmeta/readers/csl_reader.py,sha256=ynqJeqK9TlHFsmgMREPmKGlcj6tVycpnqDN0N0LjIpw,3201
22
22
  commonmeta/readers/datacite_reader.py,sha256=CdOtxhthrakBoQMsLTdPx6sUCmqtEWo5ICYE6ZsWDdo,12026
23
23
  commonmeta/readers/datacite_xml_reader.py,sha256=nhnO92fZihr1HZlbXjyem-HJXc9_DWLgJ2zeltuPMIg,13041
24
- commonmeta/readers/inveniordm_reader.py,sha256=uS92St68UkO4Adh3PsCu9ox81aO0kek3Y0vneBSDkts,7584
24
+ commonmeta/readers/inveniordm_reader.py,sha256=F0syoLZ3amzkrEk8efb9WxwhMDY8QM8ctOH32E3fGqM,8358
25
25
  commonmeta/readers/json_feed_reader.py,sha256=vzT3RpPhmPuJHLQWk3HajIuCTzut83L0ZfLR__ErP0g,13265
26
26
  commonmeta/readers/kbase_reader.py,sha256=ehKXQsJyPCtaq2FmBxNb2Jb5Nktpx8pNscpmEM6N0A4,6763
27
27
  commonmeta/readers/ris_reader.py,sha256=v6qOd-i2OcMTEFy5RGd3MlYthJcYSU6yzmZ5yHDzmII,3677
@@ -70,8 +70,8 @@ commonmeta/writers/datacite_writer.py,sha256=UpDp4Brg5xrmS5T3QYoNi6PPXKdRxAo254e
70
70
  commonmeta/writers/inveniordm_writer.py,sha256=-GsTcVMPlbbB9kSTmHP00ZJ1aHIbA21K0LkcuPWBMm8,11429
71
71
  commonmeta/writers/ris_writer.py,sha256=AcnCszS3WY9lF594NbFBtLylsA8ownnYp_XLQJ84Ios,2093
72
72
  commonmeta/writers/schema_org_writer.py,sha256=5j002uCNLdlScZMNQmPjodcVWqaBh2z38zL1H4lo2hY,5741
73
- commonmeta_py-0.88.dist-info/METADATA,sha256=8feVwg3o3aNQX4Khp5d54_DJUY4BU46hu2O8Ueuf8Eo,7429
74
- commonmeta_py-0.88.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
75
- commonmeta_py-0.88.dist-info/entry_points.txt,sha256=U4w4BoRuS3rN5t5Y-uYSyOeU5Lh_VRVMS9OIDzIgw4w,50
76
- commonmeta_py-0.88.dist-info/licenses/LICENSE,sha256=746hEF2wZCKkcckk5-_DcBLtHewfaEMS4iXTlA1PVwk,1074
77
- commonmeta_py-0.88.dist-info/RECORD,,
73
+ commonmeta_py-0.89.dist-info/METADATA,sha256=M2Wjppi09_3V2op_xctTMRyJmcicLzVksMmp-LKxvaQ,7429
74
+ commonmeta_py-0.89.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
75
+ commonmeta_py-0.89.dist-info/entry_points.txt,sha256=U4w4BoRuS3rN5t5Y-uYSyOeU5Lh_VRVMS9OIDzIgw4w,50
76
+ commonmeta_py-0.89.dist-info/licenses/LICENSE,sha256=746hEF2wZCKkcckk5-_DcBLtHewfaEMS4iXTlA1PVwk,1074
77
+ commonmeta_py-0.89.dist-info/RECORD,,