ver Jan2nd

calc metrics are prapared by and large
This commit is contained in:
David Chang
2024-01-02 21:03:57 +08:00
parent d41c674a91
commit 6e6ef03bc9
9 changed files with 208 additions and 10 deletions

View File

@@ -0,0 +1,13 @@
from pypdf import PdfReader
import operator
from typing import Dict
from typing import Any
def check_pdf_pages(pdf_file: str, rules: Dict[str, Any]) -> float:
reader = PdfReader(pdf_file)
nb_pages: int = len(reader.pages)
return float( getattr(operator, rules["relation"])( nb_pages
, rules["ref_value"]
)
)