diff options
| author | Martin Czygan <martin.czygan@gmail.com> | 2021-06-07 20:33:37 +0200 | 
|---|---|---|
| committer | Martin Czygan <martin.czygan@gmail.com> | 2021-06-07 20:33:37 +0200 | 
| commit | bcc30c8a365a09e011e520d2905007cf51362440 (patch) | |
| tree | 2b3143781fc54f3f93495768eb2a2c148df131d0 /python | |
| parent | c0fdb73fb256dac576e5e8e5e50ecea6524328dd (diff) | |
| download | refcat-bcc30c8a365a09e011e520d2905007cf51362440.tar.gz refcat-bcc30c8a365a09e011e520d2905007cf51362440.zip | |
add OpenLibraryZipISBN
Diffstat (limited to 'python')
| -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  # ------------------ | 
