aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/refcat/tasks.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/python/refcat/tasks.py b/python/refcat/tasks.py
index 8df25f2..5e53f98 100644
--- a/python/refcat/tasks.py
+++ b/python/refcat/tasks.py
@@ -375,6 +375,25 @@ class ReleaseExportReduced(Refcat):
def output(self):
return luigi.LocalTarget(path=self.path(ext="json.zst"), format=Zstd)
+class ReleaseIdentDOIList(Refcat):
+ """
+ Create TSV (ident, doi).
+ """
+ def requires(self):
+ return ReleaseExportExpanded()
+
+ def run(self):
+ output = shellout("""
+ zstdcat -T0 {input} |
+ parallel --block 10M -j 20 --pipe
+ "jq -rc 'select(.ext_ids.doi != null) | [.ident, .ext_ids.doi] | @tsv'" > {output}
+ """,
+ input=self.input().path)
+ luigi.LocalTarget(output).move(self.output().path)
+
+ def output(self):
+ return luigi.LocalTarget(path=self.path(ext="tsv"))
+
class UnmatchedRefs(Refcat):
"""