Metadata-Version: 2.4
Name: ai4gs
Version: 0.1.2
Summary: AI-Powered Google Scholar Assistant
Author: Li Mengke
License: MIT License
        
        Copyright (c) 2025 Li Mengke
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/LIMENGKE24/AI-Agent-GoogleScholarAlertEmail
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: beautifulsoup4
Requires-Dist: python-dotenv
Requires-Dist: markdown
Requires-Dist: anthropic
Dynamic: license-file

# 📚 AI-Agent for Google Scholar Alert Email (AI4GS)

Automated pipeline to fetch Google Scholar Alert emails, extract paper information, summarize content using Claude/Gemini, and generate clean, structured research reports.

This project helps researchers efficiently process Google Scholar Alerts without manually reading hundreds of emails. It downloads new alerts, parses them, summarizes papers using Claude/Gemini CLI, and outputs a consolidated report.

---

## 🌟 Features

- 🔍 **Automatically fetch Google Scholar Alert emails** via IMAP
- 📩 **Store email content locally** for later processing
- 🧠 **Call Claude/Gemini CLI model** to summarize papers (install [Claude](https://github.com/anthropics/claude-code) or [Gemini](https://github.com/google-gemini/gemini-cli))
- 📝 **Generate clean research reports** in Markdown and HTML format
- 🎯 **Keyword filtering** for domain-specific relevance
- 📧 **Email reports automatically** to configured recipients
- ⚙️ **Easy Configuration** via interactive CLI or `.env` file

---

## 📦 Installation

### 1. Create a Virtual Environment (Recommended)

It is recommended to use a virtual environment to avoid conflicts.

**Using Conda:**
```bash
conda create -n ai4gs python=3.12 -y
conda activate ai4gs
```

### 2. Install Package

Simply install the package from PyPI:

```bash
pip install ai4gs
```

---

## ▶️ Usage

### 1. Initialize Configuration

First, run the initialization command to set up your credentials and preferences. This will create a `.env` file in your current directory.

```bash
ai4gs init
```

Follow the interactive prompts to enter your:
- Gmail Address
- Gmail App Password (Not login password, and required for IMAP access. [Generate one here](https://support.google.com/mail/answer/185833?hl=en))
- Anthropic API Key (Required for AI summarization)
- Research Keywords (Comma-separated list of topics, e.g., "machine learning, climate change")

### 2. Run the Agent

Start the research automation pipeline:

```bash
ai4gs run
```

### 🔧 Configuration

The `ai4gs init` command creates a `.env` file where you can adjust settings. You can also manually edit this file.

**Key Settings:**
- `KEYWORDS`: Comma-separated list of research topics.
- `REPORT_RECEIVER_EMAIL`: Where to send the report.
- `RECENT_COUNT`: Number of recent emails to check (default: 10).
- `TODAY_ONLY`: Set to `True` to only check today's emails.

---

## 📄 License

MIT License. Free to use, modify, and distribute.
