leaf_focus/pipeline/prefect_flow/construct.py
def build_pdf(
        self,
        base_dir: Path,
        pdf_info_exe: Path,
        pdf_text_exe: Path,
        pdf_image_exe: Path,
    ):
        """Build the pdf Prefect flow."""

        with Flow("leaf-focus") as flow:
            feed_dir = Parameter("feed_dir")

            download_task = DownloadCrawlTask()
            download_items = download_task(feed_dir)

            pdf_identify_task = PdfIdentifyTask(base_dir)
            pdf_identify_items = pdf_identify_task.map(download_items)

            pdf_info_task = PdfInfoTask(base_dir, pdf_info_exe)
            pdf_info_task.map(pdf_identify_items)

            pdf_text_task = PdfTextTask(base_dir, pdf_text_exe)
            pdf_text_task.map(pdf_identify_items)

            pdf_images_task = PdfImagesTask(base_dir, pdf_image_exe)
            pdf_images_task.map(pdf_identify_items)

        return flow
Build the pdf Prefect flow.
Build the pdf Prefect flow.
Build the pdf Prefect flow .
def build_pdf(
        self,
        base_dir: Path,
        pdf_info_exe: Path,
        pdf_text_exe: Path,
        pdf_image_exe: Path,
    ):
        with Flow("leaf-focus") as flow:
            feed_dir = Parameter("feed_dir")
            download_task = DownloadCrawlTask()
            download_items = download_task(feed_dir)
            pdf_identify_task = PdfIdentifyTask(base_dir)
            pdf_identify_items = pdf_identify_task.map(download_items)
            pdf_info_task = PdfInfoTask(base_dir, pdf_info_exe)
            pdf_info_task.map(pdf_identify_items)
            pdf_text_task = PdfTextTask(base_dir, pdf_text_exe)
            pdf_text_task.map(pdf_identify_items)
            pdf_images_task = PdfImagesTask(base_dir, pdf_image_exe)
            pdf_images_task.map(pdf_identify_items)
        return flow
def build_pdf ( self , base_dir : Path , pdf_info_exe : Path , pdf_text_exe : Path , pdf_image_exe : Path , ) : with Flow ( "leaf-focus" ) as flow : feed_dir = Parameter ( "feed_dir" ) download_task = DownloadCrawlTask ( ) download_items = download_task ( feed_dir ) pdf_identify_task = PdfIdentifyTask ( base_dir ) pdf_identify_items = pdf_identify_task . map ( download_items ) pdf_info_task = PdfInfoTask ( base_dir , pdf_info_exe ) pdf_info_task . map ( pdf_identify_items ) pdf_text_task = PdfTextTask ( base_dir , pdf_text_exe ) pdf_text_task . map ( pdf_identify_items ) pdf_images_task = PdfImagesTask ( base_dir , pdf_image_exe ) pdf_images_task . map ( pdf_identify_items ) return flow
Build the pdf Prefect flow.
Build the pdf Prefect flow .
"""Build the pdf Prefect flow."""
self
base_dir
Path
pdf_info_exe
Path
pdf_text_exe
Path
pdf_image_exe
Path