leaf_focus/pdf/identify/item.py
def save(cls, path: Path, items: Iterable["Item"]) -> None:
        """Save file items to a file."""
        fields = ["pdf_file", "hash_type", "file_hash"]
        with open(path, "wt", newline="", encoding="utf8") as f:
            writer = csv.DictWriter(f, fields)
            writer.writeheader()
            for i in items:
                writer.writerow(
                    {
                        "pdf_file": str(i.pdf_file),
                        "hash_type": i.hash_type,
                        "file_hash": i.file_hash,
                    }
                )
Save file items to a file.
Save file items to a file.
Save file items to a file .
def save(cls, path: Path, items: Iterable["Item"]) -> None:
        fields = ["pdf_file", "hash_type", "file_hash"]
        with open(path, "wt", newline="", encoding="utf8") as f:
            writer = csv.DictWriter(f, fields)
            writer.writeheader()
            for i in items:
                writer.writerow(
                    {
                        "pdf_file": str(i.pdf_file),
                        "hash_type": i.hash_type,
                        "file_hash": i.file_hash,
                    }
                )
def save ( cls , path : Path , items : Iterable [ "Item" ] ) -> None : fields = [ "pdf_file" , "hash_type" , "file_hash" ] with open ( path , "wt" , newline = "" , encoding = "utf8" ) as f : writer = csv . DictWriter ( f , fields ) writer . writeheader ( ) for i in items : writer . writerow ( { "pdf_file" : str ( i . pdf_file ) , "hash_type" : i . hash_type , "file_hash" : i . file_hash , } )
Save file items to a file.
Save file items to a file .
"""Save file items to a file."""
cls
path
Path
items
Iterable["Item"]