leaf_focus/report/item/skipped_page.py
def save(cls, path: Path, items: Iterable["SkippedPage"]):
        """Save items to a csv file."""
        fields = [
            "pdf_page",
            "pdf_url",
            "pdf_hash_type",
            "pdf_hash_value",
            "pdf_path",
        ]
        path.parent.mkdir(parents=True, exist_ok=True)
        with open(path, "wt", newline="", encoding="utf8") as f:
            writer = csv.DictWriter(f, fields, dialect="excel")
            writer.writeheader()
            for i in items:
                writer.writerow(
                    {
                        "pdf_page": i.pdf_page,
                        "pdf_url": i.pdf_url,
                        "pdf_hash_type": i.pdf_hash_type,
                        "pdf_hash_value": i.pdf_hash_value,
                        "pdf_path": i.pdf_path,
                    }
                )
Save items to a csv file.
Save items to a csv file.
Save items to a csv file .
def save(cls, path: Path, items: Iterable["SkippedPage"]):
        fields = [
            "pdf_page",
            "pdf_url",
            "pdf_hash_type",
            "pdf_hash_value",
            "pdf_path",
        ]
        path.parent.mkdir(parents=True, exist_ok=True)
        with open(path, "wt", newline="", encoding="utf8") as f:
            writer = csv.DictWriter(f, fields, dialect="excel")
            writer.writeheader()
            for i in items:
                writer.writerow(
                    {
                        "pdf_page": i.pdf_page,
                        "pdf_url": i.pdf_url,
                        "pdf_hash_type": i.pdf_hash_type,
                        "pdf_hash_value": i.pdf_hash_value,
                        "pdf_path": i.pdf_path,
                    }
                )
def save ( cls , path : Path , items : Iterable [ "SkippedPage" ] ) : fields = [ "pdf_page" , "pdf_url" , "pdf_hash_type" , "pdf_hash_value" , "pdf_path" , ] path . parent . mkdir ( parents = True , exist_ok = True ) with open ( path , "wt" , newline = "" , encoding = "utf8" ) as f : writer = csv . DictWriter ( f , fields , dialect = "excel" ) writer . writeheader ( ) for i in items : writer . writerow ( { "pdf_page" : i . pdf_page , "pdf_url" : i . pdf_url , "pdf_hash_type" : i . pdf_hash_type , "pdf_hash_value" : i . pdf_hash_value , "pdf_path" : i . pdf_path , } )
Save items to a csv file.
Save items to a csv file .
"""Save items to a csv file."""
cls
path
Path
items
Iterable["SkippedPage"]