This little script renames your PDFs based in its contents, it has the ability to extract text from images so don't worry if your PDFs are just prints of something.
It uses OpenAI API so you'll need to create an account and pay them 5$ (they stopped their free tier 😔).
You'll also need to have Poppler and Tesseract installed globally:
brew install poppler
brew install tesseract
sudo apt update
sudo apt install poppler-utils tesseract-ocr
-
Set up a virtual environment to encapsulate your Python packages, otherwise running the next command installs the dependecies globally:
python -m venv .venv
-
Install the required dependencies:
pip install -r requirements.txt
-
Set your OpenAI API key:
export OPENAI_API_KEY=YOUR_API_KEY
-
Run the main script:
python main.py