Metadata-Version: 2.5
Name: standardify-articles
Version: 0.1.3
Summary: A CLI tool to standardize article PDF filenames using Gemini LLM.
License-File: LICENSE
Requires-Python: >=3.10
Requires-Dist: google-genai==1.70.0
Requires-Dist: pydantic==2.12.5
Requires-Dist: python-dotenv>=1.0.0
Description-Content-Type: text/markdown

# 📚 Standardify Articles

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Python Version](https://img.shields.io/badge/python-3.10%2B-blue)](https://www.python.org/)
[![uv](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json)](https://github.com/astral-sh/uv)

A lightweight CLI tool to automatically rename academic PDF articles into a standardized format using LLMs (Gemini API) for semantic metadata extraction.

Keep your sources organized, keep your articles *standard*! ✨

---

## 📄 Output Filename Schema

```text
[publishing_year]_[main_author_surname]['EtAl']_[title_capitalized]_[venue_acronym].pdf
```

### Example
- **Original**: `document_final_v2.pdf`
- **Renamed**: `2023_SmithEtAl_AttentionIsAllYouNeed_NeurIPS.pdf`

---

## 🚀 Installation

Install globally using [`uv`](https://github.com/astral-sh/uv):

```bash
uv tool install standardify-articles
```

To update to the latest version at any time:

```bash
uv tool install standardify-articles --force
```

---

## 🔑 API Key Configuration

The tool uses the Gemini API. You can supply your API key in any of the following ways (resolved in order):

1. **CLI Flag**:
   ```bash
   standardify-articles --api-key "your-gemini-api-key"
   ```

2. **Environment Variable**:
   ```bash
   export GEMINI_API_KEY="your-gemini-api-key"
   ```

3. **User Config File**:
   Create `~/.config/standardify-articles/.env`:
   ```env
   GEMINI_API_KEY="your-gemini-api-key"
   ```

---

## ⚙️ Usage

Navigate to a folder containing article PDFs and run:

```bash
# Process current directory
standardify-articles

# Process a specific directory
standardify-articles /path/to/pdf/folder

# View help and options
standardify-articles --help
```

---

## 📜 License

Distributed under the [MIT License](LICENSE).
