aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2021-05-29 02:27:34 +0200
committerMartin Czygan <martin.czygan@gmail.com>2021-05-29 02:27:34 +0200
commitc033a545e83bcbf8d1b99c6c2efd7c75b59d32b0 (patch)
treef832c4fa7e2adb8ea96f0a560e05e2194048dad2 /python
parentb37a447ae1620c8578d4fd9f221087b265d86cfe (diff)
downloadrefcat-c033a545e83bcbf8d1b99c6c2efd7c75b59d32b0.tar.gz
refcat-c033a545e83bcbf8d1b99c6c2efd7c75b59d32b0.zip
tasks: add UnmatchedOpenLibraryMatchTable
Diffstat (limited to 'python')
-rw-r--r--python/refcat/tasks.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/python/refcat/tasks.py b/python/refcat/tasks.py
index b8a942c..0656f3c 100644
--- a/python/refcat/tasks.py
+++ b/python/refcat/tasks.py
@@ -862,3 +862,27 @@ class UnmatchedMapped(Refcat):
def output(self):
return luigi.LocalTarget(path=self.path(ext="tsv.zst"), format=Zstd)
+
+
+class UnmatchedOpenLibraryMatchTable(Refcat):
+ """
+ Run matching and write tabular results to file.
+ """
+ def requires(self):
+ return {
+ "unmatched": UnmatchedMapped(),
+ "ol": OpenLibraryEditionsMapped(),
+ }
+
+ def run(self):
+ output = shellout("""
+ skate-reduce -m oled
+ -O <(zstdcat -T0 {ol})
+ -F <(zstdcat -T0 {unmatched}) |
+ zstd -c > {output}
+ """,
+ ol=self.input().get("ol").path,
+ unmatched=self.input().get("unmatched").path)
+
+ def output(self):
+ return luigi.LocalTarget(path=self.path(ext="tsv.zst"), format=Zstd)