Metadata-Version: 2.4
Name: respf
Version: 1.0.1
Summary: Download academic papers from ArXiv, Google Scholar, ACM, Springer, and GitHub
Author-email: Madhav <support@example.com>
License: MIT License
        
        Copyright (c) 2026 Madhav Kadam
        
        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/madhaviit/respf-python
Keywords: research,papers,academic,download,arxiv,scholar
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Science/Research
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests>=2.28.0
Requires-Dist: beautifulsoup4>=4.11.0
Requires-Dist: arxiv>=1.4.0
Requires-Dist: lxml>=4.9.0
Requires-Dist: aiohttp>=3.8.0
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-asyncio>=0.21.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: flake8>=6.0.0; extra == "dev"
Requires-Dist: mypy>=1.0.0; extra == "dev"
Provides-Extra: summarize
Requires-Dist: pdftotext>=2.1.5; extra == "summarize"
Dynamic: license-file

# respf - Research Paper Fetcher

A Python package for downloading academic papers from ArXiv, Google Scholar, ACM, Springer, and GitHub.

## Installation

```bash
pip install respf
```

## Usage

### CLI

```bash
# Download by title
respf "Attention Is All You Need"

# Download by ArXiv URL
respf https://arxiv.org/abs/2103.00020

# Specify sources
respf "BERT" --sources arxiv,google_scholar

# Download from citations file
respf --file citations.txt --dir ./papers

# Parse academic citation formats (APA, IEEE, Chicago, MLA, BibTeX)
respf --file citations.txt --parse --dir ./papers

# Get paper info
respf --info https://arxiv.org/abs/2103.00020

# For corporate networks (SSL issues)
respf "Paper Title" --use-system-certs

# Generate summary.json for PDFs in a folder
respf --summarize --dir ./papers
```

### PDF Summarization

Generate a `summary.json` file with extracted text from all PDFs in a directory:

```bash
# Summarize all PDFs in a directory
respf --summarize --dir ./papers

# Output as JSON
respf --summarize --dir ./papers --json
```

**Output (summary.json):**
```json
[
  {
    "pdf_name": "Attention_Is_All_You_Need.pdf",
    "num_pages": 11,
    "first_page_text": "...",
    "abstract_on_first_page": true
  }
]
```

**Install with summarize support:**
```bash
pip install respf[summarize]
# Also requires: sudo apt install build-essential libpoppler-cpp-dev pkg-config
```

### Python API

```python
from respf import ResearchPaperDownloader, download_paper, get_paper_info

# Simple usage
result = download_paper("Attention Is All You Need", download_dir="papers")

# Or use the class
downloader = ResearchPaperDownloader(download_dir="papers")
result = downloader.download_paper("https://arxiv.org/abs/2103.00020")

# Get info without downloading
info = get_paper_info("Attention Is All You Need")
print(info["title"], info["authors"])
```

### Async API

```python
import asyncio
from respf import ResearchPaperDownloader

async def main():
    downloader = ResearchPaperDownloader(download_dir="papers")
    result = await downloader.async_download_paper("https://arxiv.org/abs/2103.00020")
    print(result)

asyncio.run(main())
```

## Sources

- **ArXiv** - Direct download by ID or title search
- **Google Scholar** - Search and find PDFs
- **ACM Digital Library** - Download from ACM
- **Springer Link** - Download from Springer
- **GitHub** - Find PDFs in repositories

## Options

| Flag | Description |
|------|-------------|
| `--file, -f` | File with citations (one per line) |
| `--parse` | Parse academic citation formats (APA, IEEE, Chicago, MLA, BibTeX) |
| `--dir, -d` | Download directory (default: papers) |
| `--sources, -s` | Sources to use (comma-separated) |
| `--info, -i` | Get metadata without downloading |
| `--json, -j` | Output as JSON |
| `--summarize` | Generate summary.json for PDFs in directory |
| `--use-system-certs` | Use system CA certs (corporate networks) |

## Troubleshooting

### SSL Certificate Errors

If you get SSL errors in corporate networks, use `--use-system-certs`:

```bash
respf "Paper Title" --use-system-certs
```

This uses your system's CA certificates instead of Python's certifi bundle.

## License

MIT
