Skip to main content

A CLI tool to remove passwords from PDF documents

Project description

🔓 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 codes0 on success, 1 if any files failed (great for scripting)

Installation

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

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

Usage

# 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 (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

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

License

MIT

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

pdfunlockercli-1.0.0.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

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

pdfunlockercli-1.0.0-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file pdfunlockercli-1.0.0.tar.gz.

File metadata

  • Download URL: pdfunlockercli-1.0.0.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pdfunlockercli-1.0.0.tar.gz
Algorithm Hash digest
SHA256 de04c46d95621ae27de81aaec1fe4c3b52b9856405a7431cf590f5331331259e
MD5 9aa908f35d22ece699e9fe2ae77a01ff
BLAKE2b-256 7636663de5faf9b50f97325ad8db73f4775a1850a135e018a61f427ee2204919

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdfunlockercli-1.0.0.tar.gz:

Publisher: publish.yml on krishnaGauss/PDF-Unlock

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pdfunlockercli-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pdfunlockercli-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pdfunlockercli-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8c475b7487829807cdc027ef6967abdc7cf4a618e94cb6ec6cbbae576c3fb302
MD5 aad0b60c75ef19cafc660236819a0c14
BLAKE2b-256 66836a8acab782f6dcf8ef40d95429e62b5562289d4ddce3796fcbd821652aa6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pdfunlockercli-1.0.0-py3-none-any.whl:

Publisher: publish.yml on krishnaGauss/PDF-Unlock

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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