aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2020-01-06 22:25:53 +0100
committerMartin Czygan <martin.czygan@gmail.com>2020-01-06 22:25:53 +0100
commitff37b97e4bbf642efbd830111fe3dbd45ae56dad (patch)
tree4801672459a16af5caf88e9f92fee9468ac94051 /python
parent171c4ae9f48984438e59bf521b3ec9dd78ce6d3d (diff)
downloadfatcat-ff37b97e4bbf642efbd830111fe3dbd45ae56dad.tar.gz
fatcat-ff37b97e4bbf642efbd830111fe3dbd45ae56dad.zip
datacite: include month in extra
> include release_month as a top-level extra field [...] to auto-populate the schema field from that
Diffstat (limited to 'python')
-rw-r--r--python/fatcat_tools/importers/datacite.py2
-rw-r--r--python/tests/files/datacite/datacite_result_00.json3
-rw-r--r--python/tests/files/datacite/datacite_result_05.json3
-rw-r--r--python/tests/files/datacite/datacite_result_12.json2
-rw-r--r--python/tests/files/datacite/datacite_result_13.json2
-rw-r--r--python/tests/files/datacite/datacite_result_18.json2
-rw-r--r--python/tests/files/datacite/datacite_result_19.json2
-rw-r--r--python/tests/files/datacite/datacite_result_20.json2
-rw-r--r--python/tests/files/datacite/datacite_result_21.json2
-rw-r--r--python/tests/files/datacite/datacite_result_22.json2
-rw-r--r--python/tests/files/datacite/datacite_result_23.json2
-rw-r--r--python/tests/files/datacite/datacite_result_24.json2
12 files changed, 15 insertions, 11 deletions
diff --git a/python/fatcat_tools/importers/datacite.py b/python/fatcat_tools/importers/datacite.py
index f9d1b49a..a673f00b 100644
--- a/python/fatcat_tools/importers/datacite.py
+++ b/python/fatcat_tools/importers/datacite.py
@@ -603,6 +603,8 @@ class DataciteImporter(EntityImporter):
extra_datacite['license'] = license_extra
if attributes.get('subjects'):
extra_datacite['subjects'] = attributes['subjects']
+ if release_month:
+ extra_datacite['month'] = release_month
# Include certain relations from relatedIdentifiers. Keeping the
# original structure of data here, which is a list of dicts, with
diff --git a/python/tests/files/datacite/datacite_result_00.json b/python/tests/files/datacite/datacite_result_00.json
index a4b28076..ad917b92 100644
--- a/python/tests/files/datacite/datacite_result_00.json
+++ b/python/tests/files/datacite/datacite_result_00.json
@@ -2,6 +2,7 @@
"extra": {
"container_name": "Journal of Chemical Crystallography",
"datacite": {
+ "month": 5,
"license": [
{
"rightsUri": "http://www.springer.com/tdm"
@@ -84,4 +85,4 @@
}
],
"abstracts": []
-} \ No newline at end of file
+}
diff --git a/python/tests/files/datacite/datacite_result_05.json b/python/tests/files/datacite/datacite_result_05.json
index 1840884e..cea2a25c 100644
--- a/python/tests/files/datacite/datacite_result_05.json
+++ b/python/tests/files/datacite/datacite_result_05.json
@@ -6,7 +6,8 @@
"rights": "Attribution-NonCommercial (CC BY-NC)",
"rightsUri": "http://creativecommons.org/licenses/by-nc/4.0"
}
- ]
+ ],
+ "month": 10
}
},
"title": "SH409843.07FU",
diff --git a/python/tests/files/datacite/datacite_result_12.json b/python/tests/files/datacite/datacite_result_12.json
index 5dbcd8d0..646299cf 100644
--- a/python/tests/files/datacite/datacite_result_12.json
+++ b/python/tests/files/datacite/datacite_result_12.json
@@ -1,5 +1,5 @@
{
- "extra": {"datacite": {}},
+ "extra": {"datacite": {"month": 6}},
"title": "Anthropometric and Physiological Profile of Mixed Martial Art Athletes: A Brief Review",
"release_type": "article-journal",
"release_stage": "published",
diff --git a/python/tests/files/datacite/datacite_result_13.json b/python/tests/files/datacite/datacite_result_13.json
index 2509f27e..fea722c7 100644
--- a/python/tests/files/datacite/datacite_result_13.json
+++ b/python/tests/files/datacite/datacite_result_13.json
@@ -1,5 +1,5 @@
{
- "extra": {"datacite": {}},
+ "extra": {"datacite": {"month": 10}},
"title": "[M\u00fcssen wir des Gl\u00fccks uns sch\u00e4men?]",
"release_type": "article-journal",
"release_stage": "published",
diff --git a/python/tests/files/datacite/datacite_result_18.json b/python/tests/files/datacite/datacite_result_18.json
index d0b53222..6599fe08 100644
--- a/python/tests/files/datacite/datacite_result_18.json
+++ b/python/tests/files/datacite/datacite_result_18.json
@@ -1,5 +1,5 @@
{
- "extra": {"datacite": {}},
+ "extra": {"datacite": {"month": 8}},
"title": "Eastern questionnaire, answer sheet for Interviewee 53215, page 064",
"release_type": "article",
"release_stage": "published",
diff --git a/python/tests/files/datacite/datacite_result_19.json b/python/tests/files/datacite/datacite_result_19.json
index 55b43684..5598ccee 100644
--- a/python/tests/files/datacite/datacite_result_19.json
+++ b/python/tests/files/datacite/datacite_result_19.json
@@ -1,5 +1,5 @@
{
- "extra": {"datacite": {}},
+ "extra": {"datacite": {"month": 8}},
"title": "Eastern questionnaire, answer sheet for Interviewee 55236, page 092",
"release_type": "article",
"release_stage": "published",
diff --git a/python/tests/files/datacite/datacite_result_20.json b/python/tests/files/datacite/datacite_result_20.json
index 48063d9d..ec2dfc38 100644
--- a/python/tests/files/datacite/datacite_result_20.json
+++ b/python/tests/files/datacite/datacite_result_20.json
@@ -1,5 +1,5 @@
{
- "extra": {"datacite": {}},
+ "extra": {"datacite": {"month": 8}},
"title": "<h1>Eastern questionnaire</h1>",
"release_type": "article",
"release_stage": "published",
diff --git a/python/tests/files/datacite/datacite_result_21.json b/python/tests/files/datacite/datacite_result_21.json
index 99dcad1b..b5e2207a 100644
--- a/python/tests/files/datacite/datacite_result_21.json
+++ b/python/tests/files/datacite/datacite_result_21.json
@@ -1,5 +1,5 @@
{
- "extra": {"datacite": {}},
+ "extra": {"datacite": {"month": 8}},
"title": "ABC",
"release_type": "article",
"release_stage": "published",
diff --git a/python/tests/files/datacite/datacite_result_22.json b/python/tests/files/datacite/datacite_result_22.json
index 30d75a3d..bd1290c2 100644
--- a/python/tests/files/datacite/datacite_result_22.json
+++ b/python/tests/files/datacite/datacite_result_22.json
@@ -1,5 +1,5 @@
{
- "extra": {"datacite": {}},
+ "extra": {"datacite": {"month": 8}},
"title": "ABC",
"release_type": "article",
"release_stage": "published",
diff --git a/python/tests/files/datacite/datacite_result_23.json b/python/tests/files/datacite/datacite_result_23.json
index f79053df..599d1b37 100644
--- a/python/tests/files/datacite/datacite_result_23.json
+++ b/python/tests/files/datacite/datacite_result_23.json
@@ -1,5 +1,5 @@
{
- "extra": {"datacite": {}},
+ "extra": {"datacite": {"month": 8}},
"title": "ABC",
"release_type": "article",
"release_stage": "published",
diff --git a/python/tests/files/datacite/datacite_result_24.json b/python/tests/files/datacite/datacite_result_24.json
index a7fc59ba..a3649867 100644
--- a/python/tests/files/datacite/datacite_result_24.json
+++ b/python/tests/files/datacite/datacite_result_24.json
@@ -1,5 +1,5 @@
{
- "extra": {"datacite": {}},
+ "extra": {"datacite": {"month": 8}},
"title": "ABC",
"subtitle": "DEF",
"release_type": "article",