Skip to main content

Automate arXiv paper tracking with LLM-powered metadata extraction and Google Sheets sync.

Project description

arXivFlow 🚀

License: MIT Python 3.13+ Static Badge Ollama arXiv

arXivFlow is a powerful Python-based automation tool designed to streamline the research paper discovery and tracking process. It autonomously fetches metadata from arXiv, performs local AI-driven analysis using Ollama (e.g., Llama 3.2), and synchronizes the results with Google Sheets and local databases.


✨ Features

  • Asynchronous API: Fully rewritten with asyncio for high-performance paper retrieval and PDF processing.
  • Automated Retrieval: Fetch the latest papers from specific arXiv categories (e.g., cs.AI, cs.LG, hep-ph) within any date range.
  • Local AI Analysis: Uses Ollama models (e.g., Llama 3.2) to extract keywords and contact information (emails/affiliations) directly from PDF text. No cloud API costs or data privacy concerns.
  • Intelligent PDF Handling: Automatically downloads PDFs and extracts text for deep analysis. Supports custom storage paths.
  • Robust Rate Limiting: Built-in compliance with arXiv's API guidelines (3-second request intervals).
  • Multi-Format Export: Save your research data to CSV, JSON, Excel, or SQLite for flexible offline analysis.
  • Google Sheets Sync: Seamlessly push compiled research data to a shared Google Sheet for team collaboration.
  • Type-Safe & Modular: Clean, documented Python code with full type hinting and a class-based architecture.

🛠️ Prerequisites

  1. Python 3.13+: Ensure you have a modern Python environment.
  2. Ollama: Install Ollama and download the required model (e.g., Llama 3.2):
    ollama pull llama3.2
    
  3. Google Cloud Credentials:
    • Enable the Google Sheets and Google Drive APIs.
    • Create a Service Account and download the JSON key as credentials.json.
    • Ensure the service account has 'Editor' permissions on the sheet.

🚀 Installation

From PyPI (Recommended)

pip install arxivflow

From Source (For Development)

  1. Clone the repository:

    git clone https://github.com/zjzhao/arXivFlow.git
    cd arXivFlow
    
  2. Set up virtual environment:

    python -m venv .
    source bin/activate  # On Windows: Scripts\activate
    
  3. Install dependencies:

    pip install -e .
    

📖 Usage

Quick Start (Async)

import asyncio
import datetime
from arxivflow import arXivFlow

async def main():
    # 1. Initialize the flow
    flow = arXivFlow(
        categories=["cs.AI", "cs.CV"], 
        ollama_model="llama3.2",
        max_results=20,
        start_date=datetime.datetime.now() - datetime.timedelta(days=7)
    )

    # 2. Fetch data & Extract info (Keywords/Contacts)
    df = await flow.get_arxiv_data(download_pdfs=True)

    # 3. Save to your preferred formats
    flow.save_to_csv("my_research.csv")
    flow.save_to_sqlite("research.db")

    # 4. Sync with Google Sheets
    flow.save_to_google_sheet(
        sheet_id="YOUR_SHEET_ID", 
        credentials_file="credentials.json"
    )
    
    # 5. Close the client
    await flow.close()

if __name__ == "__main__":
    asyncio.run(main())

🏗️ Architecture

The project follows a modular structure for easy extension:

  • src/arxivflow/arxivflow.py: The main orchestrator class (arXivFlow).
  • src/arxivflow/ollama_functions.py: Local LLM interface using the Ollama API.
  • src/arxivflow/arxiv_functions.py: Asynchronous arXiv API interaction layer.
  • src/arxivflow/categories.py: arXiv category definitions.

📜 License

This project is licensed under the MIT License - see the LICENSE file for details.

🤝 Contributing

Contributions are what make the open-source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arxivflow-0.2.0.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

arxivflow-0.2.0-py3-none-any.whl (14.4 kB view details)

Uploaded Python 3

File details

Details for the file arxivflow-0.2.0.tar.gz.

File metadata

  • Download URL: arxivflow-0.2.0.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for arxivflow-0.2.0.tar.gz
Algorithm Hash digest
SHA256 6a3c99125bb6e4348e3baf4208263fc72fafca010a09256936043a82860d5785
MD5 d3fc3afa6eacaa4d867efb577159d37c
BLAKE2b-256 e2a35b3b83581495af48238119078fe0ea8affe59b9f10120f1fdc75425cc9e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for arxivflow-0.2.0.tar.gz:

Publisher: python-publish.yml on zjzhao1002/arXivFlow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file arxivflow-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: arxivflow-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 14.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for arxivflow-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c9aa5143043e633def0a010d6acdabe8334b99047588eb4bca3250d9becf79fc
MD5 943259853707ebf9bd0f228646447a88
BLAKE2b-256 f703cc300002167d3f197c9c6a11a31a77935175fd14e353e8660b4e3c26c124

See more details on using hashes here.

Provenance

The following attestation bundles were made for arxivflow-0.2.0-py3-none-any.whl:

Publisher: python-publish.yml on zjzhao1002/arXivFlow

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page