aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--python/refcat/tasks.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/python/refcat/tasks.py b/python/refcat/tasks.py
index 36250ba..c4e5b56 100644
--- a/python/refcat/tasks.py
+++ b/python/refcat/tasks.py
@@ -279,6 +279,7 @@ class OpenLibraryAuthors(luigi.ExternalTask, Refcat):
def output(self):
return luigi.LocalTarget(path=settings.OL_DUMP_AUTHORS, format=Zstd)
+
# ----8< Derivations
#
@@ -1039,6 +1040,31 @@ class UnmatchedOpenLibraryMatchTable(Refcat):
return luigi.LocalTarget(path=self.path(ext="tsv.zst"), format=Zstd)
+class BrefZipOpenLibrary(Refcat):
+ """
+ Export fuzzy matches to open library targets.
+ """
+ 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)
+ luigi.LocalTarget(output).move(self.output().path)
+
+ def output(self):
+ return luigi.LocalTarget(path=self.path(ext="json.zst"), format=Zstd)
+
+
#
# Extra
# -----