https://github.com/gusanmaz/artitle
A Python CLI program for batch renaming academic article PDFs to their titles.
https://github.com/gusanmaz/artitle
academic-articles arvix grobid pdf-generation pdf-rename renaming-files
Last synced: 3 months ago
JSON representation
A Python CLI program for batch renaming academic article PDFs to their titles.
- Host: GitHub
- URL: https://github.com/gusanmaz/artitle
- Owner: gusanmaz
- License: mit
- Created: 2023-03-01T22:32:05.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-03-01T22:38:32.000Z (about 2 years ago)
- Last Synced: 2025-01-20T14:57:42.432Z (4 months ago)
- Topics: academic-articles, arvix, grobid, pdf-generation, pdf-rename, renaming-files
- Language: Python
- Homepage: https://pypi.org/project/artitle/
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Academic Article Renamer
Academic Article Renamer (artitle) is a command-line interface (CLI) tool that renames academic articles to their titles. It solves the problem of cryptic default file names that many academic article repositories provide. The CLI uses the [Grobid](https://grobid.readthedocs.io/en/latest/) server to extract the title from the PDF file and renames the file accordingly.
## Installation
You can install artitle using pip:
```sh
pip install artitle
```# Usage
To use artitle, you must have Grobid server running on your computer. You can refer to the Grobid documentation for information on how to run the server.
According to our observations Grobid needs to eat up substantial amounts of memory to be able to perform it's job. We recommend to allocate at least `6GB` memory for Grobid Server to avoid runtime failures. To run the container with `6GB` memory you could type the following command:
```bash
docker run -m 6g -p 8070:8070 grobid/grobid:0.7.2
```Once you have the Grobid server running, you can use the CLI to rename your article PDFs. To rename all the PDFs in a directory, run the following command:
```shell
artitle
```he argument should be the path to the directory containing the PDF files that you want to rename.
By default, the CLI uses underscores (_) to replace spaces in the file names. If you want to use a different character to replace spaces, you can specify it using the -s or --space-replace option:
```shell
artitle -s "-"
```This command uses hyphens (-) to replace spaces in the file names.
The program creates a new directory named pdfs_with_old_names inside the directory containing the PDF files. Before renaming any PDF files, the program copies the original PDF files into this directory with their original names, so that you can easily revert the changes if anything goes wrong.
After renaming the PDF files, the program creates a file named renaming.txt inside the directory containing the PDF files. This file contains information about the renaming of each PDF file, with one row for each file. The rows include the original file name, the new file name, and any characters that were replaced with hyphens (-) because they could cause problems in file names.
Grobid Server generates an XML file for each processed PDF file. These XML files are stored in xml directory inside the directory containing PDF files.
# License
Academic Article Renamer is licensed under the MIT License. See the LICENSE file for more information.