Scientific Paper PDF Rename (sci_rename for short) is a command line tool that helps you to rename all your scientific paper according to their titles. The proposed tool scans the PDF file of your papers in order to find its title and rename the pdf file of the paper accordingly.
sci_rename looks for the title at two different places. First it tries to find the title using the pdf metadata. When pdf files are carefuly created the title of the paper can be included into the pdf metadata. Unfortunately, this practice not as frequent as we expect. To overcome that we use the following assumption. The title of a scientific paper is usually formatted with the largest font of the text. Therefore, sci_rename also scans the first page of the paper and try to identify a bounded size sentence with the largest font size. If it finds a potential title in both cases (i.e., metadata and larger font approach), it asks the user to choose one between them.
We recommend using Python 3.11.6 and PyMuPDF 1.22.5.
However, we have tested the following versions.
Python version |
PyMuPDF required |
3.11.6 |
1.22.5 |
3.8.18 |
1.22.5 |
3.7.17 |
1.22.5 |
3.7.0 |
1.18.14 |
|:boom: DANGER |: Using unverified versions may lead to a malfunctioning installation !!
If your version is higher than you can use pyenv to install multiple versions of Python in your machine.
If your current version doesn’t align with these requirements, you can utilize pyenv to install multiple Python versions on your machine and execute it within a virtualized environment. Install the dependency as recommended in the following.
-
Clone the project in your machine
$ git clone https://github.com/heversonbr/scientific-paper-pdf-rename.git
-
Enter in the created directory
$ cd scientific-paper-pdf-rename
-
Set a python virtual environment to avoid mixing the required packages with your global installed packages.
$ python3 -m venv .venv
-
Activate your virtual environment
$ source .venv/bin/activate
-
Check the installed packages and update you pip , if required.
$ pip list $ python3 -m pip install --upgrade pip
-
Install the dependencies.
$ python3 -m pip install -r requirements.txt
You can run the script to rename a simple file or a target directory as follows.
$ python3 sci_rename.py <target_directory>
or
$ python3 sci_rename.py <pdf_filename.pdf>
The output will be in a directory called auto_renamed
.
Use the examples
directory to test the renaming tool if you wish.