Metadata-Version: 2.4
Name: sci-paper-rename
Version: 1.0.2
Summary: A tool that automatically renames scientific paper PDF files based on their titles. It scans the PDF content to detect the paper’s title and uses it to generate a clean, meaningful filename.
Author-email: "Heverson B. Ribeiro" <heversonbr@gmail.com>
License: GNU Affero General Public License v3
Project-URL: Homepage, https://github.com/heversonbr/sci-paper-rename
Project-URL: Bug Tracker, https://github.com/heversonbr/sci-paper-rename/issues
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Operating System :: OS Independent
Requires-Python: <3.12.0,>=3.11.6
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: PyMuPDF==1.26.0
Dynamic: license-file

# Scientific Paper Rename (sci-paper-rename)

Tired of messy filenames for all your scientific papers? **sci-paper-rename** is here to help! This handy command-line tool automatically renames your PDFs using their actual paper titles — no more guesswork or manual renaming.

Just run it on your folder of papers, and watch it tidy up your files with neat, meaningful names. Easy, fast, and stress-free!


## Introduction

Scientific Paper Rename (or **sci-paper-rename**, for short) is a command-line tool that makes organizing your scientific papers a breeze. It scans each PDF to find the paper’s title and then renames the file to match — so your folders stay neat and easy to navigate.

## Approach

**_sci-paper-rename_** looks for the title in two places:

1. **PDF Metadata**: If the PDF was carefully created, the title might be stored in its metadata.
2. **Largest Font on First Page**: If metadata is unavailable or unreliable, the tool scans the first page of the paper, looking for a sentence with the **largest font size**, assuming it's the title.

If both methods succeed, the user is prompted to choose which title to use.

## Dependencies

The current version depends on **Python 3.11.6** and **PyMuPDF 1.26.0**. 
Please make sure to have them installed before running the package!

If your version doesn't match, use [pyenv](https://github.com/pyenv/pyenv) to install Python version 3.11.6.

## Installation

You can install **sci-paper-rename** easily with pip:

### From PyPI (once published)

```bash
pip install sci-paper-rename
```

### From GitHub repository (latest development version)

```bash
pip install git+https://github.com/heversonbr/sci-paper-rename.git
```

### Or, if you prefer to install locally after cloning

```bash
git clone https://github.com/heversonbr/sci-paper-rename.git
cd sci-paper-rename
python3 -m venv .venv
source .venv/bin/activate
pip install .
```

## Usage

After installation, use the tool from the command line.


**Rename all files in a directory**

```bash
python3 sci-paper-rename.py </path/to/target_directory>
```

**Rename a single PDF file**

```bash
sci-paper-rename /path/to/specific-paper.pdf
```

**Show help message**

```bash
sci-paper-rename --help
```
