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 codes —
0on success,1if 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:
- Open the PDF with the provided password
- 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
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 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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de04c46d95621ae27de81aaec1fe4c3b52b9856405a7431cf590f5331331259e
|
|
| MD5 |
9aa908f35d22ece699e9fe2ae77a01ff
|
|
| BLAKE2b-256 |
7636663de5faf9b50f97325ad8db73f4775a1850a135e018a61f427ee2204919
|
Provenance
The following attestation bundles were made for pdfunlockercli-1.0.0.tar.gz:
Publisher:
publish.yml on krishnaGauss/PDF-Unlock
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pdfunlockercli-1.0.0.tar.gz -
Subject digest:
de04c46d95621ae27de81aaec1fe4c3b52b9856405a7431cf590f5331331259e - Sigstore transparency entry: 1263713458
- Sigstore integration time:
-
Permalink:
krishnaGauss/PDF-Unlock@673dbc469a701bc8aa21325c2bb409078e9a550b -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/krishnaGauss
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@673dbc469a701bc8aa21325c2bb409078e9a550b -
Trigger Event:
release
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8c475b7487829807cdc027ef6967abdc7cf4a618e94cb6ec6cbbae576c3fb302
|
|
| MD5 |
aad0b60c75ef19cafc660236819a0c14
|
|
| BLAKE2b-256 |
66836a8acab782f6dcf8ef40d95429e62b5562289d4ddce3796fcbd821652aa6
|
Provenance
The following attestation bundles were made for pdfunlockercli-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on krishnaGauss/PDF-Unlock
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pdfunlockercli-1.0.0-py3-none-any.whl -
Subject digest:
8c475b7487829807cdc027ef6967abdc7cf4a618e94cb6ec6cbbae576c3fb302 - Sigstore transparency entry: 1263713545
- Sigstore integration time:
-
Permalink:
krishnaGauss/PDF-Unlock@673dbc469a701bc8aa21325c2bb409078e9a550b -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/krishnaGauss
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@673dbc469a701bc8aa21325c2bb409078e9a550b -
Trigger Event:
release
-
Statement type: