aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2021-05-14 09:58:39 +0200
committerMartin Czygan <martin.czygan@gmail.com>2021-05-14 09:58:39 +0200
commit7efcf41275ad8d8e4d28bc7beae435f20121c487 (patch)
tree946cdc0ece3690dbd1be0c1d688859c6cdaef1b0
parentd60b6257288f5ff8221eebb70b7ca2a4626095e3 (diff)
downloadrefcat-7efcf41275ad8d8e4d28bc7beae435f20121c487.tar.gz
refcat-7efcf41275ad8d8e4d28bc7beae435f20121c487.zip
add task: RefsToRelease
-rw-r--r--python/refcat/tasks.py20
1 files changed, 20 insertions, 0 deletions
diff --git a/python/refcat/tasks.py b/python/refcat/tasks.py
index 6fefc6a..3dcdd65 100644
--- a/python/refcat/tasks.py
+++ b/python/refcat/tasks.py
@@ -415,6 +415,26 @@ class RefsArxiv(Refcat):
return luigi.LocalTarget(path=self.path(ext="tsv.zst"), format=Zstd)
+class RefsToRelease(Refcat):
+ """
+ Convert refs to release.
+ """
+ def requires(self):
+ return RefsWithUnstructured()
+
+ def run(self):
+ output = shellout("""
+ zstdcat -T0 {input} |
+ skate-conv -f ref -w 24 -b 100000 |
+ zstd -T0 -c > {output}
+ """,
+ input=self.input().path)
+ luigi.LocalTarget(output).move(self.output().path)
+
+ def output(self):
+ return luigi.LocalTarget(path=self.path(ext="tsv.zst"), format=Zstd)
+
+
class FatcatDOI(Refcat):
"""
DOI from fatcat.