diff options
Diffstat (limited to 'python')
-rw-r--r-- | python/refcat/tasks.py | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/python/refcat/tasks.py b/python/refcat/tasks.py index 915d406..f21fade 100644 --- a/python/refcat/tasks.py +++ b/python/refcat/tasks.py @@ -295,6 +295,29 @@ class URLTabs(Refcat): def output(self): return luigi.LocalTarget(path=self.path(ext="tsv.zst"), format=Zstd) +class URLList(Refcat): + """ + List of cleaned URLs from refs. + """ + def requires(self): + return URLList() + + def run(self): + output = shellout(""" + zstdcat -T0 {input} | + cut -f 3 | + skate-cleanup -c url -B -S -f 1 | + LC_ALL=C sort -T {tmpdir} -k1,1 -S25% --parallel 4 | + zstd -T0 -c > {output} + """, + n=self.n, + tmpdir=self.tmpdir, + 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 RefsDOI(Refcat): """ Sorted (doi, doc) tuples from refs. 225m48.755s @@ -306,7 +329,7 @@ class RefsDOI(Refcat): output = shellout(""" zstdcat -T0 {input} | skate-map -m ff -x biblio.doi -skip-on-empty 1 | - skate-to-doi -f 1 | + skate-cleanup -c doi -f 1 | LC_ALL=C sort -T {tmpdir} -k1,1 -S25% --parallel 4 | zstd -T0 -c > {output} """, |