Skip to main content

A package based on SciHub and Google Scholar that can download articles given DOI, website address or keywords.

Project description

getarticle Python

Description

getarticle is a package based on SciHub and Google Scholar that can download articles given DOI, website address or keywords.

Install

Using pip to install:

# for latest version (recommended)
pip install git+https://github.com/HTian1997/getarticle.git

# for last release
pip install getarticle

install

Features & Usage

getarticle can be imported in Python or used as command line.

To use in command line:

usage: getarticle [-h] [-i INPUT] [-o OUTPUT] [-sd SETDOWNLOAD]

getarticle CLI

optional arguments:
  -h, --help            show this help message and exit
  -i INPUT, --input INPUT
                        article DOI or website
  -o OUTPUT, --output OUTPUT
                        download direction
  -sd SETDOWNLOAD, --setdownload SETDOWNLOAD
                        set default download direction

Example:

getarticle -i 10.1126/science.abc7424 -o /Users/haotian/Desktop

The download direction is the current direction in terminal by default. To change the default download direction, use -sd option.

Example:

getarticle -sd /Users/haotian/Downloads

# will download to /Users/haotian/Downloads folder
getarticle -i 10.1126/science.abc7424

getarticle can also download article of the current webpage (only supported for MacOS Safari).

Example:

# current Safari webpage: 
# https://www.nature.com/articles/s41467-020-16670-2

# download article of current webpage to default direction
getarticle

one-line

To use in Python:

  1. Initialization
from getarticle import GetArticle

ga = GetArticle()
  1. Download a single article given DOI or website address.
ga.input_article("10.1126/science.abc7424")
ga.download()

Notes:

  • Once downloaded, all stored articles will be cleared;
  • For download function, direction argument is the current direction by default;
  • Downloaded article is named as either "article title.pdf" if successfull or "year-month-day-hour-minute-second.pdf".
  1. Download multiple articles.
ga.input_article("https://www.nature.com/articles/s41594-020-0468-7#article-info")
ga.input_article("10.1038/s41893-020-0581-y")
ga.download()

Notes:

  • Repeatedly using article function can save multiple articles.
  • getarticle will not save & download duplicate articles;
  1. Download related articles given keywords. Keywords can be article names, research fields or author names. (This feature is under development.)
ga.search("Deep Dive into Machine Learning Models for Protein Engineering")
ga.search("SARS, Computation", num_of_page=2)
ga.search("Roberta Croce")
ga.download()

Notes:

  • num_of_page is the corresponding number of page in Google Scholar.
  • num_of_page is 1 by default.
  1. Show currently stored articles / delete article by index.
ga.cur_articles()

ga.remove_article()

License

MIT

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

getarticle-dev-0.0.7.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

getarticle_dev-0.0.7-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file getarticle-dev-0.0.7.tar.gz.

File metadata

  • Download URL: getarticle-dev-0.0.7.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.0.0.post20200309 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for getarticle-dev-0.0.7.tar.gz
Algorithm Hash digest
SHA256 ff8995e0049f807ae620f8d8c95558290e36c671a547c43577f59ec65f587416
MD5 0aa055c1a2ec24b239f59f19dcf87f03
BLAKE2b-256 04649efe225945f9611288e859ce784031752a07cf7e581a5c92c189a65bfe8d

See more details on using hashes here.

File details

Details for the file getarticle_dev-0.0.7-py3-none-any.whl.

File metadata

  • Download URL: getarticle_dev-0.0.7-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.0.0.post20200309 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for getarticle_dev-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 27cbd650b3e27f9815b4d87e18e142b277f9a9f7f8fb0e100cb4006d9221e8c6
MD5 ee2204def6d7a5a02b50f7c033f257dd
BLAKE2b-256 f5660c7c55429242204acca0ff620d2022b0b170a41b99e46f9fa711a7f01f7e

See more details on using hashes here.

Supported by

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