commonmeta-py 0.17.2__tar.gz → 0.17.3__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.
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/PKG-INFO +1 -1
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/author_utils.py +4 -1
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/crossref_utils.py +14 -11
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/readers/crossref_reader.py +3 -3
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/readers/datacite_reader.py +14 -16
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/commonmeta_v0.13.json +0 -2
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/writers/datacite_writer.py +1 -1
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/pyproject.toml +1 -1
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/LICENSE +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/README.md +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/__init__.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/api_utils.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/base_utils.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/cli.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/constants.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/date_utils.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/doi_utils.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/metadata.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/readers/__init__.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/readers/bibtex_reader.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/readers/cff_reader.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/readers/codemeta_reader.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/readers/commonmeta_reader.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/readers/crossref_xml_reader.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/readers/csl_reader.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/readers/datacite_xml_reader.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/readers/inveniordm_reader.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/readers/json_feed_reader.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/readers/kbase_reader.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/readers/ris_reader.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/readers/schema_org_reader.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/cff_v1.2.0.json +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/commonmeta_v0.12.json +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/crossref/AccessIndicators.xsd +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/crossref/JATS-journalpublishing1-3d2-mathml3-elements.xsd +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/crossref/JATS-journalpublishing1-3d2-mathml3.xsd +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/crossref/JATS-journalpublishing1-elements.xsd +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/crossref/JATS-journalpublishing1-mathml3-elements.xsd +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/crossref/JATS-journalpublishing1-mathml3.xsd +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/crossref/JATS-journalpublishing1.xsd +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/crossref/clinicaltrials.xsd +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/crossref/common5.3.1.xsd +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/crossref/crossref5.3.1.xsd +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/crossref/crossref_query_output3.0.xsd +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/crossref/fundref.xsd +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/crossref/module-ali.xsd +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/crossref/relations.xsd +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/crossref-v0.2.json +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/csl-data.json +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/datacite-v4.5.json +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/ietf-bcp-47.json +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/iso-8601.json +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/spdx/licenses.json +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/spdx-schema..json +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/styles/apa.csl +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/styles/chicago-author-date.csl +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/styles/harvard-cite-them-right.csl +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/styles/ieee.csl +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/styles/modern-language-association.csl +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/styles/vancouver.csl +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/schema_utils.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/translators.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/utils.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/writers/__init__.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/writers/bibtex_writer.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/writers/citation_writer.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/writers/commonmeta_writer.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/writers/crossref_xml_writer.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/writers/csl_writer.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/writers/ris_writer.py +0 -0
- {commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/writers/schema_org_writer.py +0 -0
@@ -108,6 +108,9 @@ def get_one_author(author, **kwargs):
|
|
108
108
|
else:
|
109
109
|
given_name = None
|
110
110
|
family_name = None
|
111
|
+
|
112
|
+
# support various keys for affiliations
|
113
|
+
affiliations = author.get("affiliation", None) or author.get("affiliations", None)
|
111
114
|
|
112
115
|
# return author in commonmeta format, using name vs. given/family name
|
113
116
|
# depending on type
|
@@ -119,7 +122,7 @@ def get_one_author(author, **kwargs):
|
|
119
122
|
"name": name if _type == "Organization" else None,
|
120
123
|
"givenName": given_name if _type == "Person" else None,
|
121
124
|
"familyName": family_name if _type == "Person" else None,
|
122
|
-
"
|
125
|
+
"affiliations": presence(get_affiliations(wrap(affiliations))
|
123
126
|
),
|
124
127
|
}
|
125
128
|
)
|
@@ -131,8 +131,12 @@ def insert_crossref_contributors(metadata, xml):
|
|
131
131
|
]
|
132
132
|
for num, contributor in enumerate(con):
|
133
133
|
contributor_role = (
|
134
|
-
"author" if contributor.get("contributorRoles")
|
134
|
+
"author" if "Author" in contributor.get("contributorRoles") else None
|
135
135
|
)
|
136
|
+
if contributor_role is None:
|
137
|
+
contributor_role = (
|
138
|
+
"editor" if "Editor" in contributor.get("contributorRoles") else None
|
139
|
+
)
|
136
140
|
sequence = "first" if num == 0 else "additional"
|
137
141
|
if (
|
138
142
|
contributor.get("type", None) == "Organization"
|
@@ -153,7 +157,7 @@ def insert_crossref_contributors(metadata, xml):
|
|
153
157
|
{"contributor_role": contributor_role, "sequence": sequence},
|
154
158
|
)
|
155
159
|
person_name = insert_crossref_person(contributor, person_name)
|
156
|
-
elif contributor.get("
|
160
|
+
elif contributor.get("affiliations", None) is not None:
|
157
161
|
anonymous = etree.SubElement(
|
158
162
|
contributors,
|
159
163
|
"anonymous",
|
@@ -176,18 +180,17 @@ def insert_crossref_person(contributor, xml):
|
|
176
180
|
if contributor.get("familyName", None) is not None:
|
177
181
|
etree.SubElement(xml, "surname").text = contributor.get("familyName")
|
178
182
|
|
179
|
-
if contributor.get("
|
183
|
+
if contributor.get("affiliations", None) is not None:
|
180
184
|
affiliations = etree.SubElement(xml, "affiliations")
|
181
185
|
institution = etree.SubElement(affiliations, "institution")
|
182
|
-
if py_.get(contributor, "
|
186
|
+
if py_.get(contributor, "affiliations.0.name") is not None:
|
183
187
|
etree.SubElement(institution, "institution_name").text = py_.get(
|
184
|
-
contributor, "
|
188
|
+
contributor, "affiliations.0.name"
|
185
189
|
)
|
186
|
-
if py_.get(contributor, "
|
190
|
+
if py_.get(contributor, "affiliations.0.id") is not None:
|
187
191
|
etree.SubElement(
|
188
192
|
institution, "institution_id", {"type": "ror"}
|
189
|
-
).text = py_.get(contributor, "
|
190
|
-
|
193
|
+
).text = py_.get(contributor, "affiliations.0.id")
|
191
194
|
orcid = normalize_orcid(contributor.get("id", None))
|
192
195
|
if orcid is not None:
|
193
196
|
etree.SubElement(xml, "ORCID").text = orcid
|
@@ -196,13 +199,13 @@ def insert_crossref_person(contributor, xml):
|
|
196
199
|
|
197
200
|
def insert_crossref_anonymous(contributor, xml):
|
198
201
|
"""Insert crossref anonymous"""
|
199
|
-
if contributor.get("
|
202
|
+
if contributor.get("affiliations", None) is None:
|
200
203
|
return xml
|
201
204
|
affiliations = etree.SubElement(xml, "affiliations")
|
202
205
|
institution = etree.SubElement(affiliations, "institution")
|
203
|
-
if py_.get(contributor, "
|
206
|
+
if py_.get(contributor, "affiliations.0.name") is not None:
|
204
207
|
etree.SubElement(institution, "institution_name").text = py_.get(
|
205
|
-
contributor, "
|
208
|
+
contributor, "affiliations.0.name"
|
206
209
|
)
|
207
210
|
return xml
|
208
211
|
|
@@ -95,7 +95,7 @@ def read_crossref(data: Optional[dict], **kwargs) -> Commonmeta:
|
|
95
95
|
identifiers.append(
|
96
96
|
compact(
|
97
97
|
{
|
98
|
-
"identifier":
|
98
|
+
"identifier": _id,
|
99
99
|
"identifierType": "DOI",
|
100
100
|
}
|
101
101
|
)
|
@@ -144,11 +144,11 @@ def read_crossref(data: Optional[dict], **kwargs) -> Commonmeta:
|
|
144
144
|
"type": _type,
|
145
145
|
# recommended and optional properties
|
146
146
|
"additionalType": None,
|
147
|
-
"archiveLocations": archive_locations,
|
147
|
+
"archiveLocations": presence(archive_locations),
|
148
148
|
"container": presence(container),
|
149
149
|
"contributors": presence(contributors),
|
150
150
|
"date": presence(date),
|
151
|
-
"descriptions": descriptions,
|
151
|
+
"descriptions": presence(descriptions),
|
152
152
|
"files": presence(files),
|
153
153
|
"fundingReferences": presence(funding_references),
|
154
154
|
"geoLocations": None,
|
@@ -113,28 +113,26 @@ def read_datacite(data: dict, **kwargs) -> Commonmeta:
|
|
113
113
|
# required properties
|
114
114
|
"id": _id,
|
115
115
|
"type": _type,
|
116
|
-
"doi": doi_from_url(_id),
|
117
|
-
"url": normalize_url(meta.get("url", None)),
|
118
|
-
"contributors": presence(contributors),
|
119
|
-
"titles": titles,
|
120
|
-
"publisher": publisher,
|
121
|
-
"date": compact(date),
|
122
116
|
# recommended and optional properties
|
123
117
|
"additionalType": additional_type,
|
124
|
-
"
|
125
|
-
"
|
118
|
+
"container": presence(container),
|
119
|
+
"contributors": presence(contributors),
|
120
|
+
"date": compact(date),
|
121
|
+
"descriptions": presence(descriptions),
|
122
|
+
"files": presence(files),
|
123
|
+
"fundingReferences": presence(meta.get("fundingReferences", None)),
|
124
|
+
"geoLocations": presence(geo_locations),
|
126
125
|
"identifiers": presence(identifiers),
|
127
|
-
"
|
126
|
+
"language": meta.get("language", None),
|
128
127
|
"license": presence(license_),
|
129
|
-
"
|
130
|
-
"
|
131
|
-
"fundingReferences": presence(meta.get("fundingReferences", None)),
|
128
|
+
"provider": "DataCite",
|
129
|
+
"publisher": publisher,
|
132
130
|
"references": presence(references),
|
133
131
|
"relations": presence(relations),
|
134
|
-
|
135
|
-
"
|
136
|
-
"
|
137
|
-
"
|
132
|
+
"subjects": presence(subjects),
|
133
|
+
"titles": presence(titles),
|
134
|
+
"url": normalize_url(meta.get("url", None)),
|
135
|
+
"version": meta.get("version", None),
|
138
136
|
} | read_options
|
139
137
|
|
140
138
|
|
@@ -248,7 +248,6 @@
|
|
248
248
|
"$ref": "#/definitions/contributorRole"
|
249
249
|
},
|
250
250
|
"type": "array",
|
251
|
-
"minItems": 1,
|
252
251
|
"uniqueItems": true
|
253
252
|
}
|
254
253
|
}
|
@@ -333,7 +332,6 @@
|
|
333
332
|
},
|
334
333
|
"required": ["url"]
|
335
334
|
},
|
336
|
-
"minItems": 1,
|
337
335
|
"uniqueItems": true
|
338
336
|
},
|
339
337
|
"fundingReferences": {
|
@@ -160,7 +160,7 @@ def to_datacite_creator(creator: dict) -> dict:
|
|
160
160
|
"familyName": creator.get("familyName", None),
|
161
161
|
"nameType": _type + "al" if _type else None,
|
162
162
|
"nameIdentifiers": name_identifiers,
|
163
|
-
"affiliation": creator.get("
|
163
|
+
"affiliation": creator.get("affiliations", None),
|
164
164
|
}
|
165
165
|
)
|
166
166
|
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/crossref/AccessIndicators.xsd
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/crossref/clinicaltrials.xsd
RENAMED
File without changes
|
File without changes
|
{commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/crossref/crossref5.3.1.xsd
RENAMED
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
|
{commonmeta_py-0.17.2 → commonmeta_py-0.17.3}/commonmeta/resources/styles/chicago-author-date.csl
RENAMED
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
|