A lightweight CLI utility for manipulating PDFS.
Project description
pdf-tool
A lightweight CLI utility for manipulating PDFs.
Features
-
Merge two PDFs
-
Rotate selected pages
-
Reverse page order
-
Delete pages
-
Operate on specific pages or ranges
-
In-place or save as new file
-
Simple and intuitive CLI with helpful options
Installation
Option 1 — Install from PyPI (recommended)
pip install pdf-tool
Option 2 — Install from source
git clone https://github.com/kavehfayyazi/pdf-tool.git
cd pdf-tool
pip install --user .
# or
python3 -m pip install --user .
If pdf-tool is not found after install, make sure the appropriate scripts folder is in your PATH:
-
macOS/Linux:
~/.local/bin -
Windows:
%APPDATA%\Python\Scripts
See Troubleshooting below for more details.
Updating & Uninstalling
Update to the latest version
If you installed from PyPI:
pip install --upgrade --user pdf-tool
# or
python3 -m pip install --upgrade --user pdf-tool
If you installed from source:
cd pdf-tool
git pull origin main
pip install --user .
# or
python3 -m pip install --user .
Uninstall
pip uninstall pdf-tool
# or
python3 -m pip uninstall pdf-tool
Usage
pdf-tool <command> [options]
Available commands:
| Command | Description |
|---|---|
merge |
Merge two PDFs |
rotate |
Rotate pages |
reverse |
Reverse page order |
delete |
Delete selected pages |
Example:
pdf-tool merge file1.pdf file2.pdf -o merged.pdf
pdf-tool rotate file.pdf -p 1:3 -a 90 -o rotated.pdf
Run:
pdf-tool --help
pdf-tool <command> --help
for full options.
Specifying Pages and Ranges
Many commands in pdf-tool allow you to operate on specific pages or ranges of pages in a PDF.
You can specify pages using:
-
Individual page numbers (1-based, e.g.
1,3,5) -
Ranges using a colon (e.g.
2:4for pages 2, 3, and 4) -
Combinations of both
Examples
| Input | Expanded Pages |
|---|---|
all |
All pages in the document (default) |
1,3,5 |
Pages 1, 3, and 5 |
2:4 |
Pages 2, 3, and 4 |
1,3:5,7 |
Pages 1, 3, 4, 5, and 7 |
Contributing
-
Fork this repository.
-
Clone your fork locally:
git clone https://github.com/<your-username>/pdf-tool.git cd pdf-tool
-
Create a new branch:
git checkout -b feature/your-feature
-
Commit your changes:
git commit -m "Add feature-name."
-
Push to the branch
git push origin feature/feature-name
-
Open a pull request.
Troubleshooting
Command not found?
Your Python "scripts" folder may not be in your PATH.
-
macOS/Linux:
Add to your shell config (
~/.bashrcor~/.zshrc):export PATH="$HOME/.local/bin:$PATH"
-
Windows:
Add
%APPDATA%\Python\Scriptsto your User PATH via System → Environment Variables.
Then restart your terminal and try pdf-tool --help again.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Contact
- Creator: kavehfayyazi
- Email: kfayyazi@andrew.cmu.edu
- Github: @kavehfayyazi
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 pdfwiz-1.0.0.tar.gz.
File metadata
- Download URL: pdfwiz-1.0.0.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6f5ee8af1b2925ce795d927ad13b8f656f16f3464a7f166e8727e34da7939513
|
|
| MD5 |
4107a812fddb5537aadf1ef43fb5f3bd
|
|
| BLAKE2b-256 |
49b22e2662b20a0fe22b2778c3229cffff8c7b26b0fe85e5f5204dba8d673c4b
|
File details
Details for the file pdfwiz-1.0.0-py3-none-any.whl.
File metadata
- Download URL: pdfwiz-1.0.0-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
42b71847497b841086827acbd574cc797f4a706c523609757f7eb8ce8d0dc9e8
|
|
| MD5 |
ea6c83497179b97269f692eebaf5f4fe
|
|
| BLAKE2b-256 |
5e2f0f1376e9cde467e6ab0322fd3268b8eebebc936ddceb16e764404de8be3f
|