A simple Python project that merges multiple PDF files from a folder into a single PDF file.
Each merged output is saved with a unique timestamped filename, so previous files are never overwritten.
- Merge all PDFs from a folder into one PDF
- Automatically generates a unique output filename
- Clean, scalable project structure
- Uses a Python virtual environment (
venv) - Minimal dependencies
Step 2: Create a Virtual Environment macOS / Linux python3 -m venv venv
Step 3: Activate the Virtual Environment macOS / Linux source venv/bin/activate
Install the required Python packages using:
pip install -r requirements.txt
Got it! Let’s make a **fully polished, professional, copy-paste-ready `README.md` section** starting from Step 4, with clear headings, code blocks, examples, and tips — all in **one go**. I’ve also corrected minor formatting issues, added consistent styling, and made it GitHub-friendly.
Here’s the final version:
````markdown
## Step 4: Install Dependencies
Install the required Python packages using:
```bash
pip install -r requirements.txtThis will install all dependencies, including:
pypdf– used for merging PDF files
Place all the PDF files you want to merge into the following folder:
data/input_pdfs/
data/input_pdfs/
├── file1.pdf
├── file2.pdf
└── file3.pdf
Note: PDF files are merged alphabetically by filename.
From the project root directory, run:
python run.pyMerged PDFs are saved to:
data/output/
merged_20260112_143522.pdf
Each run creates a new file, so no existing files are overwritten.
✅ PDFs merged successfully!
📄 Output file: data/output/merged_20260112_143522.pdf
Once you are done working on the project:
deactivate- Keep your input PDFs organized and avoid duplicate filenames.
- Ensure all PDFs are readable and not password-protected for smooth merging.
- You can run the script multiple times; each run generates a new output file with a timestamp.