- π PDF Toolkit
- π Table of Contents
- π¦ Latest Version
- π Features
- π Installation
βΆοΈ Usage- π₯οΈ Using the CLI
- π‘οΈ Code Quality
- π Troubleshooting
- π§± Project Structure
- π§ͺ Testing
- 𧬠Test Coverage
- π Logging & Error Handling
- π§ͺ Screenshots
- π€ Contributing
- π License
- π§Ύ Commit Message Convention
- π¨βπ» Author
- π Special Thanks
- π Developer Notes (Optional Read)
Welcome to PDF Toolkit β a clean and simple desktop app built to help you merge, rename, and split PDF files effortlessly. Whether you're handling academic papers, work documents, or just organizing your digital clutter, this tool gets the job done quickly and easily.
Version: v1.2.0
Release Date: October 24, 2025
Status: Stable
Download: PDF-Toolkit.v1.2.0.zip
- π οΈ Fix: Merge operation now correctly logs skipped, password-protected, and invalid PDFs in both CLI in
core/operations.
- π₯οΈ CLI refactor: moved entry point to
cli/__main__.pyfor standard Python packaging. - π CLI now uses subcommands (
merge,split,rename,batch_merge,batch_rename,batch_split) instead of flags. - π‘οΈ Improved handling for encrypted PDFs: CLI can now process encrypted PDFs with password prompts (
--skip-alloption remains available). - π Updated CLI usage examples in documentation to reflect subcommand syntax.
- π‘οΈ Added GUI prompt for encrypted PDFs: operations now ask for password instead of stopping abruptly.
- π Updated core modules to support password callbacks for encrypted PDFs.
- β‘ Minor improvements and bug fixes.
- π Merge PDFs β Combine multiple PDF files into one.
- βοΈ Rename PDFs β Give your PDF files cleaner, more meaningful names.
- βοΈ Split PDFs β Break up large PDFs into smaller files or extract specific pages.
- π€ Extract PDFs β Extract custom page ranges or specific pages from PDFs.
- π·οΈ Batch Processing β Perform batch operations like merging all PDFs in a folder into one (with optional move), rename PDFs of entire folder at once, or split a PDF into multiple single-paged PDFs at once.
- π₯οΈ Command-Line Interface (CLI) β Automate PDF operations like merge, rename, and split via terminal commands. Ideal for power users and scripting.
- ποΈ Encrypted PDFs Support β When encountering an encrypted PDF, the app will prompt you for the password rather than failing silently.
- </> CLI (v1.3.0): Refactored with subcommands and improved encrypted PDF support.
- π― User-friendly interface β No learning curve, just click and go.
- β‘ Lightweight & fast β Minimal dependencies and blazing performance.
- π» Cross-platform β Built with Python & Tkinter; runs on Windows and (with small tweaks) on macOS/Linux too.
To install and run PDF Toolkit locally:
-
Clone the repository:
git clone https://github.com/JourneyCodesAyush/pdf-toolkit.git cd pdf-toolkit -
(Recommended) Create and activate a virtual environment:
python -m venv venv # On Linux/macOS: source venv/bin/activate # On Windows CMD: venv\Scripts\activate.bat # On Windows PowerShell: .\venv\Scripts\Activate.ps1
-
Install dependencies:
pip install -r requirements.txt
-
(Optional) Make an executable (for Windows):
First make sure Pyinstaller is installed
pip install pyinstaller
Then run:
pyinstaller main.spec
π‘ Tip: The generated .exe can be found inside dist/.
CLI Usage: The command-line interface is included for advanced users and automation. It requires cloning the repo and running via Python scripts (see Usage section).
Windows Quick Launch
This project includes a launch_windows.bat file to help run the app on Windows.
Note: I'm not very experienced with Batch scripting, so while this script works on my setup, it's possible that issues might come up on other systems. If you're a Windows user and run into problems, feel free to open an issue or submit a fix!
.\launch_windows.batLinux Quick Launch
chmod +x launch_linux.sh
launch_linux.shStart the application using:
python main.pyYouβll see a friendly window with three options: Merge, Rename, or Split your PDFs. Just follow the prompts and youβre good to go!
For automation or advanced use cases, PDF Toolkit includes a CLI interface. After cloning the repo and installing dependencies, you can run:
python main_cli.py --help
or
python -m cli --helpThis will show available commands such as:
mergerenamesplitbatch_mergebatch_renamebatch_split--versionor-v--skip-all
Example:
Recommended
python -m cli merge --input file1.pdf file2.pdf --output merged.pdfTip: You can still run
python main_cli.py ...but usingpython -m cliis preferred for standard Python packaging.
π‘οΈ Note: Encrypted PDFs are now supported in the CLI. The app will prompt for a password if needed. You can still use
--skip-allto bypass encrypted files.
Note: CLI is intended for users comfortable with command-line tools and requires cloning the repository and installing dependencies. The GUI remains the recommended interface for typical users.
This project uses pre-commit hooks to automatically enforce code style and catch common issues before each commit.
It includes formatting tools like black and other useful checks.
Contributors are encouraged to install and run these hooks locally. Developers should refer to CONTRIBUTING.md for setup and usage instructions.
If you run into any issues, try the following steps:
-
Python version: Make sure you are using Python 3.9 or above. Check your version with:
python --version
-
Virtual environment: If dependencies arenβt installing or the app crashes, try setting up and activating a virtual environment (see Installation section).
-
Missing dependencies: Run
pip install -r requirements.txtagain to ensure all required packages are installed.
-
Permission errors: On some systems, you might need to run commands with elevated permissions (e.g., sudo on Linux/Mac).
-
App doesnβt launch: Check the terminal or command prompt for error messages and share them when reporting bugs.
-
Still stuck? Open an issue on GitHub or contact the author.
pdf_toolkit/
βββ assets/ # Icons and images (e.g., app icon)
βββ gui/ # GUI layer for PDF operations
β βββ main_window.py # Main window structure and layout
β βββ merge_gui.py
β βββ rename_gui.py
β βββ split_gui.py
βββ core/ # Core PDF logic (merge, rename, split)
βββ config/ # Logging and global configuration
βββ tests/ # Unit and integration tests
βββ logs/ # Logs for user activity and errors
βββ user_config/ # Persistent user preferences (created at runtime)
βββ main.py # Entry point of launching the app
βββ requirements.txt # Python package dependencies
βββ SECURITY.md # How to report security vulnerabilities
βββ CONTRIBUTING.md # Contribution guidelines for developers
βββ CODE_OF_CONDUCT.md # Rules for respectful collaboration
βββ README.md # You're reading it!
As of v0.7.0, PDF Toolkit includes a growing suite of unit tests to ensure the reliability of its core and batch features.
- Make sure
pytestis installed:
pip install pytest- Then from the project root, run:
pytest
β οΈ No module named core/: Run this command
python -m pytest- This will automatically discover and run all tests under the
tests/directory.
- Core modules: merge, split, rename
- Batch modules: batch-merge, batch-split, batch-rename
- Shared test fixtures in
tests/conftest.py
Working towards expanding test coverage. Contributions welcome!
The app is equipped with built-in logging for user actions and robust error handling. It logs user operations and captures unexpected issues to avoid crashes β helping both developers and users stay informed.
Please refer to CONTRIBUTING.md and CODE_OF_CONDUCT.md before submitting pull requests.
Feel free to fork the repo, create a new branch, and send in a pull request! Bug fixes, new features, UI tweaks β itβs all welcome.
This project is licensed under the MIT License.
MIT License
Copyright (c) 2025 JourneyCodesAyush
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the βSoftwareβ), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies
or substantial portions of the Software.
THE SOFTWARE IS PROVIDED βAS ISβ, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Starting with v0.2.0, this project follows the Conventional Commits standard.
Please use this format when writing commit messages:
<type>(<scope>): <short message>
| Type | Description |
|---|---|
feat |
A new feature |
fix |
A bug fix |
docs |
Changes to documentation only |
style |
Code formatting changes (no logic impact) |
refactor |
Code improvements that don't fix bugs or add features |
test |
Adding or modifying tests |
chore |
Routine tasks, build scripts, config changes |
feat(split): add multi-range page support
fix(rename): handle non-PDF files gracefully
docs(readme): add commit message convention section
chore: update logging configurationCrafted with care by JourneyCodesAyush Β© 2025 JourneyCodesAyush
Built with β€οΈ using Python and Tkinter. Badges powered by Shields.io Special thanks to ChatGPT (OpenAI) for helping with coding, documentation, and guidance.
- Manipulating PDFs using Python's
PyPDF2(merge, split, extract custom page ranges) - File system handling with Python's
osmodule - Command line arguments with Python's
argparsemodule - Using
pytestfor testing, with sharedfixturesinconftest.py - Creating and auto-cleaning temporary directories with
tempfile - Building GUIs with Tkinter (layouts, event handling)
- Implementing robust error handling and logging
- Writing modular, well-documented Python code
- Using Git for version control, branching, and collaboration
- Writing effective, structured documentation like this README
- Added
.github/folder containing issue and pull request templates to streamline project contributions - Added
main.specfor PyInstaller to facilitate building standalone executables - CLI now fully supports encrypted PDFs with password prompts



