Recently, i realized that I have amassed a huge number of e-books over the years and have ended up dumping them within an e-books directory on my laptop. The problem that I now faced was identifying one book from the other because a lot of them had random filenames based upon where I had downloaded them from.
So I now had a couple of requirements:
- An automated way of renaming all of these e-books to their actual titles.
- Removing all duplicate files.
After a little bit of looking around and experimenting around I finally got a Python based solution by Joseph Monaco to my problem. I then forked the orginal repo and added a couple of scripts to it to do my bidding. Now all that I need to do to auto organize all my e-books was this:-
- git clone https://github.com/sayak-sarkar/pdf-title-rename
- export PYTHONPATH=${PYTHONPATH}:$(pwd)/xmp.py
- python pdf-title-rename/pdf-title-rename.py <PATH to my ebooks directory>/*
- ./remove_duplicate.sh
And voila, all of my e-books were now auto renamed to their titles! 🙂
Come to think about it, I can work on repository a bit more to turn it into a full blown package, but then again, I’m feeling a bit lazy now that my goal’s served! Feel free to send me a Pull Request on GitHub if any of you want to automate it further! 😉