Daily Python Projects

Daily Python Projects

Count PDF Pages with Python

Level: Beginner

Ardit Sulce's avatar
Ardit Sulce
Oct 15, 2025
∙ Paid

Your task for today is to create a PDF page counter script in Python that scans a folder for PDF files and counts the pages in each file. This project introduces you to working with PDF files using PyPDF2.

Project Task

Create a PDF page counter that:

  • Scans a specified folder for all PDF files

  • Counts the number of pages in each PDF file

  • Displays the filename and page count for each PDF

  • Shows the total page count at the end

  • Uses the PyPDF2 library for PDF processing

This project gives you hands-on practice with file system operations, PDF manipulation, data aggregation, and external libraries — essential skills for document automation and batch processing.

Sample Data

You can use these PDF documents for this project. Place them in a folder and have the Python script count their pages.

Pdf+installation+instructions,+mac
2.57MB ∙ PDF file
Download
Download
Pdf+installation+instructions,+linux
1.98MB ∙ PDF file
Download
Download
Pdf+installation+instructions,+windows (1)
2.69MB ∙ PDF file
Download
Download

Expected Output

The program should output something like below when executed:

Join the Python & AI Builders Skool Community

Got questions to ask the author about this project? Join our Python & AI Builders community for weekly Python & AI videos and discussions:

skool.com/automateit

💻 Launch This Project in Colab

Open the interactive Google Colab notebook for today’s project — with full instructions, hints, and solutions.

Click the button below to start coding — no setup needed:

Keep reading with a 7-day free trial

Subscribe to Daily Python Projects to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2025 Ardit Sulce
Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture