Socket
Book a DemoInstallSign in
Socket

count-pdf-page

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

count-pdf-page

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

0.1.1
pipPyPI
Maintainers
1

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

Keywords

pdf

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.