diff options
-rw-r--r-- | python/refcat/tasks.py | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/python/refcat/tasks.py b/python/refcat/tasks.py index 0fabab6..d36784c 100644 --- a/python/refcat/tasks.py +++ b/python/refcat/tasks.py @@ -1029,6 +1029,28 @@ class OpenLibraryEditionsMapped(Refcat): return luigi.LocalTarget(path=self.path(ext="tsv.zst"), format=Zstd) +class OpenLibraryZipISBN(Refcat): + """ + Run skate-reduce from two files. + """ + def requires(self): + return { + "refs": RefsMapped(mapper="isbn"), + "ol": OpenLibraryReleaseMapped(mapper="isbn"), + } + + def run(self): + output = shellout(r""" + skate-reduce -m exact -r isbn -F <(zstdcat -T0 {refs}) -L <(zstdcat -T0 {ol}) | + zstd -c -T0 > {output} + """, + refs=self.input().get("refs").path, + fatcat=self.input().get("fatcat").path) + luigi.LocalTarget(output).move(self.output().path) + + def output(self): + return luigi.LocalTarget(path=self.path(ext="json.zst"), format=Zstd) + # # Open Library Fuzzy # ------------------ |