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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file count_pdf_page-0.1.0.tar.gz.
File metadata
- Download URL: count_pdf_page-0.1.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
493a731f903ecc3842895bdb1ee7f27d42b76b2a4edca436c8da27be7773cb5e
|
|
| MD5 |
682363ea57dcbf040b0eefbc071be0ba
|
|
| BLAKE2b-256 |
6fe4e83d457835a4f861ea518cdca9a238d936e60846c10fb15b295465b6ca08
|
File details
Details for the file count_pdf_page-0.1.0-py3-none-any.whl.
File metadata
- Download URL: count_pdf_page-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1fcce6f21057a426860bf14f7c395381be5255c5434aee847e422f305378fe3
|
|
| MD5 |
1a4c026dc180e717d73d23fe570f4a60
|
|
| BLAKE2b-256 |
fde1b0fe375837e5c011bccd0acbc763ae9237d6ca8d206842155241a976e339
|