Metadata-Version: 2.4
Name: pdf-extraction-tool
Version: 0.1.0
Summary: Extract text from PDF files via CLI
Author-email: Abdullah Fageeh <abdulfageeh@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/AbdullahFageeh/pdf-extraction-tool
Project-URL: Repository, https://github.com/AbdullahFageeh/pdf-extraction-tool
Project-URL: Issues, https://github.com/AbdullahFageeh/pdf-extraction-tool/issues
Keywords: pdf,text-extraction,cli
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Text Processing
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: PyPDF2>=3.0.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: ruff>=0.5.0; extra == "dev"
Requires-Dist: mypy>=1.13; extra == "dev"
Requires-Dist: pre-commit>=3.5.0; extra == "dev"
Requires-Dist: reportlab>=4.0.0; extra == "dev"
Requires-Dist: build>=1.0.0; extra == "dev"
Provides-Extra: backends
Requires-Dist: pdfminer.six>=20221105; extra == "backends"
Dynamic: license-file

# PDF Text Extraction

[![CI](https://github.com/AbdullahFageeh/pdf-extraction-tool/actions/workflows/quality.yml/badge.svg)](https://github.com/AbdullahFageeh/pdf-extraction-tool/actions/workflows/quality.yml)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Small utility for extracting text from PDF files with multiple backend support.

## Installation

```powershell
pip install pdf-extraction-tool
```

Or from source:

```powershell
python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -e ".[dev,backends]"
```

## Usage

```powershell
# Basic usage (uses PyPDF2 backend)
extract-pdf path\to\file.pdf

# Use pdfminer backend (requires pdfminer.six)
extract-pdf --backend pdfminer path\to\file.pdf

# Extract from encrypted PDF
extract-pdf --password secret path\to\file.pdf
```

The extracted text is written to the terminal. Redirect it to a file when needed:

```powershell
extract-pdf path\to\file.pdf > output.txt
```

## Backends

| Backend            | Install                    | Notes                                             |
| ------------------ | -------------------------- | ------------------------------------------------- |
| `pypdf2` (default) | Included                   | Fast, good for most PDFs                          |
| `pdfminer`         | `pip install pdfminer.six` | Better layout preservation, handles complex fonts |

## Verify

```powershell
python -m py_compile extract_pdf.py
extract-pdf --help
```

Keep source PDFs and generated output outside Git unless they are explicitly safe to share.
