diff options
author | Martin Czygan <martin.czygan@gmail.com> | 2021-05-14 09:58:39 +0200 |
---|---|---|
committer | Martin Czygan <martin.czygan@gmail.com> | 2021-05-14 09:58:39 +0200 |
commit | 7efcf41275ad8d8e4d28bc7beae435f20121c487 (patch) | |
tree | 946cdc0ece3690dbd1be0c1d688859c6cdaef1b0 | |
parent | d60b6257288f5ff8221eebb70b7ca2a4626095e3 (diff) | |
download | refcat-7efcf41275ad8d8e4d28bc7beae435f20121c487.tar.gz refcat-7efcf41275ad8d8e4d28bc7beae435f20121c487.zip |
add task: RefsToRelease
-rw-r--r-- | python/refcat/tasks.py | 20 |
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. |