Skip to main content

A Python package for counting pages in PDF files and generating markdown reports

Project description

Count PDF Page

A Python package for counting pages in PDF files and generating detailed markdown reports.

Features

  • 📄 Count pages in individual PDF files or entire directories
  • 📊 Generate comprehensive markdown reports with statistics
  • 🖥️ Command-line interface for easy usage
  • 🐍 Python API for programmatic use
  • 📈 Detailed statistics including average, largest, and smallest files

Installation

From PyPI (when published)

pip install count-pdf-page

From Source

git clone https://github.com/yourusername/count-pdf-page.git
cd count-pdf-page
pip install -e .

Usage

Command Line Interface

Count PDF pages in the current directory:

count-pdf-page

Count PDF pages in a specific directory:

count-pdf-page /path/to/pdf/directory

Specify custom output file:

count-pdf-page --output my_report.md

Enable verbose output:

count-pdf-page --verbose

Python API

from count_pdf_page import count_pdf_pages, process_directory, generate_markdown_report

# Count pages in a single PDF
page_count = count_pdf_pages("document.pdf")
print(f"Pages: {page_count}")

# Process entire directory
results, total_pages = process_directory("/path/to/pdfs")

# Generate markdown report
report = generate_markdown_report(results, total_pages)
print(report)

Requirements

  • Python 3.7+
  • PyPDF2

Development

Setup Development Environment

git clone https://github.com/yourusername/count-pdf-page.git
cd count-pdf-page
pip install -e ".[dev]"

Run Tests

pytest

Code Formatting

black src tests

Type Checking

mypy src

Output Example

The generated markdown report includes:

  • Summary with total files and pages
  • Detailed table of all PDF files and their page counts
  • Statistics including average pages, largest file, and smallest file
  • Timestamp of report generation

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Changelog

0.1.0

  • Initial release
  • Basic PDF page counting functionality
  • Command-line interface
  • Markdown report generation
  • Python API

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

count_pdf_page-0.1.1.tar.gz (6.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

count_pdf_page-0.1.1-py3-none-any.whl (6.5 kB view details)

Uploaded Python 3

File details

Details for the file count_pdf_page-0.1.1.tar.gz.

File metadata

  • Download URL: count_pdf_page-0.1.1.tar.gz
  • Upload date:
  • Size: 6.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for count_pdf_page-0.1.1.tar.gz
Algorithm Hash digest
SHA256 b5316da8b46aa88896c27fcb14474789db5c5f37c7d478353ed6de2dd6ba9bae
MD5 5133d08366a73e80e035721536585068
BLAKE2b-256 23f01d1f6af14b0d1828d4273f4e09b878f3a42996a79a66b27590fb02286ce9

See more details on using hashes here.

File details

Details for the file count_pdf_page-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: count_pdf_page-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.23

File hashes

Hashes for count_pdf_page-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d49821aa27727fe1b5728f89fff73b5bf9051c87e4ddc467db63cb0e82be56b2
MD5 c5261bf148064a4a45f1c7b24a818e9e
BLAKE2b-256 bfd5b6f2074017f2a101ae084d4ad7bf0237bb6bd8afc8f84d6aaf05c843c754

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page