PyPaperBot Documentation

repository·master·Indexed 20 days ago

https://github.com/ferru97/pypaperbot

A Python-based automation tool for downloading scientific papers and BibTeX entries. It fetches research materials using queries, DOIs, or Google Scholar links via sources including Google Scholar, Crossref, SciHub, and Annas Archive (SciDB).

Tokens
1.8K
Snippets
6
Records
6
Agent score
21%

What's inside PyPaperBot

  1. Install PyPaperBot on Termux

    master

    Because numpy cannot be installed directly in Termux, follow these steps to set up the environment before installing PyPaperBot:

    1. Install wget and the pointless repository.
    2. Install numpy.
    3. Set CFLAGS to avoid specific compilation errors.
    4. Install pandas.
    5. Install PyPaperBot via pip.
    pkg install wget
    wget https://its-pointless.github.io/setup-pointless-repo.sh
    pkg install numpy
    export CFLAGS="-Wno-deprecated-declarations -Wno-unreachable-code"
    pip install pandas
    pip install PyPaperbot
  2. Download papers by DOI

    master

    You can download a single paper using its DOI or a list of DOIs from a text file.

    Example: Download a single paper by DOI and use the DOI as the filename:

    python -m PyPaperBot --doi="10.0086/s41037-711-0132-1" --dwn-dir="C:\User\example\papers" --use-doi-as-filename

    Example: Download papers from a list of DOIs in a text file:

    python -m PyPaperBot --doi-file="C:\User\example\papers\file.txt" --dwn-dir="C:\User\example\papers"
  3. Download papers by query

    master

    Use the --query argument to search Google Scholar. You can specify a range of pages using --scholar-pages and filter by year using --min-year.

    Example: Download max 30 papers from first 3 pages (from 2018) using a specific Sci-Hub mirror:

    python -m PyPaperBot --query="Machine learning" --scholar-pages=3 --min-year=2018 --dwn-dir="C:\User\example\papers" --scihub-mirror="https://sci-hub.do"

    Example: Download papers from a specific page range and skip certain words:

    python -m PyPaperBot --query="Machine learning" --scholar-pages=4-7 --dwn-dir="C:\User\example\papers" --skip-words="ai,decision tree,bot"
  4. Use proxies with PyPaperBot

    master

    If you encounter bot detection or access issues, you can use proxies. You can provide a comma-separated list of proxies or use --single-proxy if the list causes errors. Always place the proxy argument at the end.

    Example: Using multiple proxies:

    python -m PyPaperBot --query=rheumatoid+arthritis --scholar-pages=1 --scholar-results=7 --dwn-dir=/download --proxy="http://1.1.1.1::8080,https://8.8.8.8::8080"

    Example: Using a single proxy:

    python -m PyPaperBot --query=rheumatoid+arthritis --scholar-pages=1 --scholar-results=7 --dwn-dir=/download --single-proxy="http://1.1.1.1::8080"
  5. PyPaperBot CLI Arguments Reference

    master

    PyPaperBot is controlled via command-line arguments.

    Argument Grouping Rules:

    • You can use only one from each of these groups:
      • --query, --doi-file, or --doi
      • --max-dwn-year or --max-dwn-cites
    • Mandatory Requirements:
      • One of --scholar-pages, --query, or --doi-file is mandatory.
      • --scholar-pages is mandatory when using --query.
      • --dwn-dir is always mandatory.
    • Proxy Usage: Always place the --proxy argument at the end of your command.
    | Arguments | Description | Type |
    |---|---|---|
    | `--query` | Query to make on Google Scholar or Google Scholar page link | string |
    | `--skip-words` | Comma separated words. Articles containing these in title/summary are ignored | string |
    | `--cites` | Paper ID (from scholar address bar) to get only citations of that paper | string |
    | `--doi` | DOI of the paper (uses only SciHub) | string |
    | `--doi-file` | File .txt containing list of DOIs (one per line) | string |
    | `--scholar-pages` | Number or range of Google Scholar pages to inspect (max 10 papers per page) | string |
    | `--dwn-dir` | Directory path to save results | string |
    | `--min-year` | Minimal publication year | int |
    | `--max-dwn-year` | Maximum number of papers to download sorted by year | int |
    | `--max-dwn-cites` | Maximum number of papers to download sorted by number of citations | int |
    | `--journal-filter` | CSV file path for journal filtering (0: ignore / 1: consider) | string |
    | `--restrict` | 0: Download only Bibtex - 1: Download only papers PDF | int |
    | `--scihub-mirror` | Mirror for Sci-Hub (auto-selected if not set) | string |
    | `--annas-archive-mirror` | Mirror for Annas Archive (SciDB). Default: `https://annas-archive.se` | string |
    | `--scholar-results` | Number of scholar results to download when `--scholar-pages=1` | int |
    | `--proxy` | Proxies to be used (specify protocol) | string |
    | `--single-proxy` | Use a single proxy (recommended if `--proxy` errors) | string |
    | `--selenium-chrome-version` | First three digits of installed Chrome version (helps avoid bot detection) | int |
    | `--use-doi-as-filename` | Save files using DOI instead of paper title | bool |
    | `-h` | Shows the help | -- |