PDF Renamer is a Python script that automatically renames PDF files based on their content, extracting the author and title information using AI-powered text analysis. It handles encrypted PDFs and provides a colorful, informative CLI output with a progress bar and results table.
- Extracts author and title information from PDF content using AI (Llama 3.1)
- Handles encrypted PDFs
- Provides colorful CLI output with progress bar and results table
- Renames PDFs based on extracted information
- Handles naming conflicts
- Python 3.6+
- See
requirements.txt
for required libraries
-
Clone this repository:
git clone https://github.com/yourusername/pdf-renamer.git cd pdf-renamer
-
Install the required dependencies:
pip install -r requirements.txt
-
Ensure you have Ollama installed and the Llama 3.1 model available. Follow the instructions on the Ollama website for installation.
Run the script from the command line, providing the path to the folder containing the PDFs you want to rename:
python rename_pdfs.py <pdf_folder>
Replace <pdf_folder>
with the path to your PDF directory.
The script will display a progress bar as it processes the PDFs and then show a table with the following information for each file:
- Original Filename
- Extracted Author
- Extracted Title
- New Filename
- The script uses the Llama 3.1 AI model through Ollama for text analysis. Ensure you have this set up correctly.
- Encrypted PDFs will be identified but not renamed.
- If the script can't extract meaningful information, the original filename will be kept.
This project is licensed under the MIT License - see the LICENSE file for details.
1.1