Skip to main content

A lightweight Python toolkit with multiple tools for PDF manipulation

Project description

PDFwerks

PDFwerks is a lightweight yet comprehensive, tool for working with PDFs. It provides essential PDF manipulation tools all in one easy to use package. All operations are performed locally on your machine, ensuring your sensitive documents stay secure and private. With PDFwerks, you can finally say goodbye to uploading your documents to shady websites or paying for basic PDF operations.

PyPI version Publish PDFwerks Deploy Docs Run pytest License

PDFwerks TUI

Documentation

Check out the official documentation here: PDFwerks Documentation. It's more detailed and well I put a lot of effort, so go see it :)

Cross Platform Support

PDFwerks is a cross platform PDF toolkit and works across all major operating systems.

It has been locally tested and verified on both Ubuntu (including WSL2) and Windows. Additionally, Continuous Integration (CI) tests are run on Windows, macOS, and Ubuntu, ensuring core functionality remains stable across environments.

⚠️ Important: tkinter is a required dependency for PDFwerks. For OS specific installation instructions, see the PDFwerks Documentation

Installation

You can install PDFwerks using pip:

pip install pdfwerks

Usage

Run the tool directly from your terminal with:

pdfwerks

Command Line Interface (CLI)

You can also use PDFwerks through the CLI for quick PDF operations without using the TUI.

Merge PDFs

pdfwerks merge file1.pdf file2.jpg [file3.pdf ...] [-o OUTPUT]
  • Merge two or more files into one PDF. (Supported File Types: *.pdf, *.jpg, *.png, *.jpeg, *.txt)
  • Use -o or --output to specify the output file path. (Defaults to ~Downloads/merged.pdf if not specified)

Compress PDFs

pdfwerks compress file.pdf [--level LEVEL] [-o OUTPUT]
  • Compress and reduce the size of a PDF file
  • Use --level to choose the compression strength - low, medium (default), or high.
  • Use -o or --output to specify the output file path. (Defaults to ~Downloads/compressed.pdf if not specified)

Convert Image to PDF

pdfwerks convert-image file.jpg [-o OUTPUT]
  • Converts any image to a PDF file (Supported File Types: *.jpg, *.png, *.jpeg)
  • Use -o or --output to specify the output file path. (Defaults to ~Downloads/converted.pdf if not specified)

Extract Text

pdfwerks extract file.pdf --format [text|markdown|json] [-o OUTPUT]
  • Extract text from a PDF file and export it to the selected formats
  • Use --format to specify the export format. This is required and must be one of: text, markdown, or json.
  • Use -o or --output to specify the output file path. (Defaults to ~Downloads/extracted.[format] if not specified)

PDF Security

Enable Password Protection
pdfwerks enable-pwd file.pdf --pwd PASSWORD [-o OUTPUT]
  • Enables password protection for a PDF file
  • Use --pwd to specify the new password for the file. This is required.
  • Use -o or --output to specify the output file path. (Defaults to ~Downloads/encrypted.pdf if not specified)
Disable Password Protection
pdfwerks disable-pwd file.pdf --pwd PASSWORD [-o OUTPUT]
  • Disables password protection for an encrypted PDF file
  • Use --pwd to specify the password for the encrypted PDF file. This is required.
  • Use -o or --output to specify the output file path. (Defaults to ~Downloads/decrypted.pdf if not specified)
Update PDF Password
pdfwerks update-pwd file.pdf --old-pwd OLD_PASSWORD --new-pwd NEW_PASSWORD [-o OUTPUT]
  • Updates the password for a password protected PDF file
  • Use --old-pwd to specify the old password and --new-pwd to specify the new password for the PDF file. These are required.
  • Use -o or --output to specify the output file path. (Defaults to ~Downloads/updated_pwd.pdf if not specified)

Help & Version

pdfwerks --help
pdfwerks --version

Note: More tools and features are in the works.

For Developers

If you want to test, contribute or customize the tool locally:

  1. Clone the repository:

    git clone https://github.com/adithya-menon-r/PDFwerks.git
    cd PDFwerks
    
  2. Create a virtual environment and activate it:

    python -m venv .venv
    .venv\Scripts\activate    # On Linux/Mac: source .venv/bin/activate
    
  3. Install dependencies and the package in editable mode:

    pip install -e .
    

Optional Dependencies

Depending on what you are working on, you can install extras as needed:

  • For tests

    pip install -e .[test]
    
  • For documentation

    pip install -e .[docs]
    

You can now make changes to the code, run tests, or build documentation without reinstalling the package.

Running Tests

Once test dependencies are installed (using pip install -e .[test]), you run the full test suite with:

pytest

All test files are located in the tests/ directory and are automatically discovered by pytest.

License

PDFwerks is licensed under the MIT LICENSE

Author

PDFwerks is developed and maintained by Adithya Menon R

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

pdfwerks-1.0.0.tar.gz (49.2 kB view details)

Uploaded Source

Built Distribution

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

pdfwerks-1.0.0-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pdfwerks-1.0.0.tar.gz
  • Upload date:
  • Size: 49.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for pdfwerks-1.0.0.tar.gz
Algorithm Hash digest
SHA256 720342758916bd3b8fb0b51d98ba6810e6ce21f8216979766f2ef23fadf94ad4
MD5 544cf5369a9251f6269b583e80ea54ff
BLAKE2b-256 34a344116ed60e9afd060abf3127c5bf4e0f40b02d776d94e5e5302f0711a8e8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pdfwerks-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 18.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for pdfwerks-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 827ba3212e5d5b66b8d6c7cd9ea83086c45f96d72b4e74b614f79d5b3bec7138
MD5 883584dbe5141cf1a033462482574d05
BLAKE2b-256 6e6ca61ddf50f152b8f4a224c7767bc0d434a5d89ec19ffa683d54a670b0a916

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