The following script count the number of pages in PDF files present in a directory
You will need python3 and the package PyPDF2:
pip install PyPDF2
To execute the program:
python3 countNumPDFPages.py -args
The program accepts infinite (kinda) arguments.