Skip to main content

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:4 for 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

  1. Fork this repository.

  2. Clone your fork locally:

    git clone https://github.com/<your-username>/pdf-tool.git
    cd pdf-tool
    
  3. Create a new branch:

    git checkout -b feature/your-feature
    
  4. Commit your changes:

    git commit -m "Add feature-name."
    
  5. Push to the branch

    git push origin feature/feature-name
    
  6. 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 (~/.bashrc or ~/.zshrc):

    export PATH="$HOME/.local/bin:$PATH"
    
  • Windows:

    Add %APPDATA%\Python\Scripts to 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

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

pdfwiz-1.0.1.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

pdfwiz-1.0.1-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file pdfwiz-1.0.1.tar.gz.

File metadata

  • Download URL: pdfwiz-1.0.1.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

Hashes for pdfwiz-1.0.1.tar.gz
Algorithm Hash digest
SHA256 7d96f957bc431446e7ffc1e7329929bba8050c114565edc03a50f267df2135fd
MD5 260babc4a1b1f10746e9661941fa0535
BLAKE2b-256 c7ce991d67eac2786ec404f135965f9ab73be19643f883e9417c4b0ddbe058ac

See more details on using hashes here.

File details

Details for the file pdfwiz-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pdfwiz-1.0.1-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

Hashes for pdfwiz-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c004420e20a71310d906b1e883ba57f662071d3ae1393935b806f3c37ef5f394
MD5 98a8301185ea7044f7cb1d312739a1a3
BLAKE2b-256 fdf6e38f2b26ca57ee09e5c58ca9a5bd26060e16f2a619e4ebba38c36094647e

See more details on using hashes here.

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