Metadata-Version: 2.4
Name: pdfunlockercli
Version: 1.0.0
Summary: A CLI tool to remove passwords from PDF documents
Author: Krish
License: MIT
Keywords: pdf,password,unlock,decrypt,cli
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: End Users/Desktop
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Utilities
Requires-Python: >=3.9
Description-Content-Type: text/markdown
Requires-Dist: pikepdf>=8.0
Requires-Dist: click>=8.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0; extra == "dev"

# 🔓 pdfunlock

A fast CLI tool for macOS & Linux to remove passwords from PDF documents.

## Features

- **Single file** — unlock one PDF at a time
- **Batch mode** — process an entire directory of PDFs
- **Recursive scanning** — find PDFs in nested subdirectories
- **Flexible output** — save alongside originals, to a separate directory, or overwrite in-place
- **Smart detection** — skips already-unlocked files, handles owner-only passwords automatically
- **Clean exit codes** — `0` on success, `1` if any files failed (great for scripting)

## Installation

```bash
# Clone and install
git clone <your-repo-url>
cd CLI_password_remover
pip install .

# Or install in development mode
pip install -e ".[dev]"
```

## Usage

```bash
# Unlock a single PDF (will prompt for password)
pdfunlock document.pdf

# Provide password directly
pdfunlock document.pdf -p mypassword

# Save to a specific output file
pdfunlock document.pdf -o unlocked_document.pdf

# Overwrite the original file
pdfunlock document.pdf -p mypassword --overwrite

# Unlock multiple files at once
pdfunlock file1.pdf file2.pdf file3.pdf -p password

# Process all PDFs in a directory
pdfunlock --dir ./my-pdfs -p password

# Recursively scan subdirectories
pdfunlock --dir ./my-pdfs --recursive -p password

# Save unlocked files to a separate folder
pdfunlock --dir ./my-pdfs -o ./unlocked -p password
```

## How It Works

`pdfunlock` uses [pikepdf](https://pikepdf.readthedocs.io/) (built on QPDF) to:

1. Open the PDF with the provided password
2. Save a new copy **without** any encryption

It does **not** crack or brute-force passwords — you must know the password.

## Running Tests

```bash
pip install -e ".[dev]"
pytest -v
```

## License

MIT
