Skip to main content

Unofficial API for retrieving documents from SciHub

Project description

Sci-Hub lib Python

Forked from Scihub Downloader which is a fork of scihub.py.

Usage

First, import the module and create an instance of the SciHub object. At this point, you can optionally specify which Sci-Hub mirror will be employed.

from scihub import SciHub

sh = SciHub(base_url="https://sci-hub.ru")

The fetch method will obtain a URL for direct downloading of an specified reference:

sh.fetch("https://doi.org/10.1111/gwmr.12285")
> 'http://dacemirror.sci-hub.ru/journal-article/0b1ec328b87368b809e0913c8591b9bc/miller2018.pdf?download=true'

The download method will automatically download the PDF from the reference into a specified location:

sh.download(
    reference="https://doi.org/10.1111/gwmr.12285",
    output_dir="./",
    pdf_filename = "paper.pdf" # This is optional
  )

CLI tool

The package features a tool to download PDF files from the command line.

scihub "https://doi.org/10.1111/gwmr.12285"

It can be called with the arguments --output/-o to specify where to save the PDF file, and with --sci-hub-url to specify the Sci-Hub mirror.

scihub "https://doi.org/10.1111/gwmr.12285" -o here.pdf --sci-hub-url "https://sci-hub.ru"

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

scihub_dmunozg-0.2.0.tar.gz (6.5 kB view hashes)

Uploaded Source

Built Distribution

scihub_dmunozg-0.2.0-py3-none-any.whl (7.5 kB view hashes)

Uploaded Python 3

Supported by

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