A quick and creative way to rename messy PDF files. Saving your precious time.
Here's how it works:
-
Read PDFs: The script scans a specified folder on your computer, looking for PDF files. It then reads the text from each PDF, Extracting the information on the first page of your PDFs that will inspire the new file names.
-
Generate Names: With the content of your PDFs in hand, the script sends a message to a smart AI service. This AI takes the content, thinks about it, and comes up with a short, catchy name for each file – no more than 5 keywords, contacted by
_
, such asA_numpy_cheatsheet
. -
Rename Files: Once the AI has suggested new names, the script goes back to your folder and renames each PDF accordingly. Now, instead of generic names like "document1.pdf" or "report.pdf," you have meaningful, concise titles that reflect the content of each file.
- 💻 Install
PyPDFs
andgroq
use command line
pip install PyPDF2 groq
-
🔑 Get your Groq AI KEY here
-
📝 open
.zshrc
file. For Mac user, it's a hidden path under your username, like/Users/jerlin/.zshrc
, check it by keyboard shortcutShift + CMD + .
Fill the code and save:
GROQ_API_KEY="REPLACE YOUR KEY"
- Clean up unanticipated characters such as
\
. - Pretty rename, no more cutting of keyword.
- Rename by LMM such as LlaVa or Gemini Pro Vision.(Also FREE).
- Say googbye to command line: release a Mac Automatic Flow, which use the
RIGHT CLICK
instead, as the example shown below.
3.17.mp4_.mp4
Have fun with AI Copilots
- 微信视频号 @oasisAI
- 微信号 oasisFM