Skip to main content

sci-dl: help you download SciHub PDF faster

Features

  1. configuration file support.
  2. search by Google Scholar(coming soon).
  3. download using DOI.
  4. custom SciHub mirror url.
  5. proxy support.
  6. failure retry.
  7. captacha support(coming soon).
  8. a Python library that can be embedded in your program.

Installation

use as command line software

pip install 'sci-dl[cmd]'

use as Python library

pip install sci-dl

Usage

use as command line software

  1. initialization configuration file
sci-dl init-config

follow the prompt to create the configuration file.

  1. download using DOI
sci-dl dl -d '10.1016/j.neuron.2012.02.004'
# 10.1016/j.neuron.2012.02.004 is the article DOI you want to download

use as Python library

sci_dl.SciDlError raises when exception happens.

if you don't have a proxy

from sci_dl import dl_by_doi


config = {
    'base_url': 'https://sci-hub.se',  # sci-hub URL
    'retries': 5,  # number of failure retries
    'use_proxy': False  # means you don't want to use a proxy
}

response = dl_by_doi('10.1016/j.neuron.2012.02.004', config)

if you use a proxy

from sci_dl import dl_by_doi


config = {
    'base_url': 'https://sci-hub.se',  # sci-hub URL
    'retries': 5,  # number of failure retries
    'use_proxy': True,  # means you don't want to use a proxy
    'proxy_protocol': 'socks5',  # available protocols: http https socks5
    'proxy_user': None,  # proxy user, if your proxy don't need one, you can pass None
    'proxy_password': None,  # proxy password, if your proxy don't need one, you can pass None
    'proxy_host': '127.0.0.1',  # proxy host
    'proxy_port': 1080  # proxy port
}

response = dl_by_doi('10.1016/j.neuron.2012.02.004', config)

how to save response?

get all content one time

with open('xxx.pdf', 'wb') as fp:
    fp.write(response.content)

chunk by chunk

with open('xxx.pdf', 'wb') as fp:
    for chunk in response.iter_content(1024):  # 1024 is the chunk size
        fp.write(chunk)

Metadata

Release files for sci-dl 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sci-dl 0.1.2
File Size Uploaded Provenance Actions
sci-dl-0.1.2.tar.gz 8.4 kB Without provenance Details for sci-dl-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sci-dl 0.1.2
File Interpreter ABI Platform Actions
sci_dl-0.1.2-py3-none-any.whl Python 3 none any Details for sci_dl-0.1.2-py3-none-any.whl

Total release size: 17.7 kB

Release files / sci-dl-0.1.2.tar.gz

Download URL sci-dl-0.1.2.tar.gz
Size 8.4 kB
Tags Source
SHA-256 checksum
How to use checksums
e2c9f5f5b72a37af1ae704b71fc3ccdf29c173594396559b6f01f2161fb8dc21
BLAKE2b-256 checksum
How to use checksums
b844f5a75254a69a39c78ccb0cd949337b0b8568f5b5be07fd5c02b2658c3538
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/29.0 requests/2.25.0 requests-toolbelt/0.9.1 urllib3/1.26.3 tqdm/4.59.0 importlib-metadata/4.11.1 keyring/23.0.0 rfc3986/1.4.0 colorama/0.4.4 CPython/3.7.9

Release files / sci_dl-0.1.2-py3-none-any.whl

Download URL sci_dl-0.1.2-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
344395c61225d8b1e44835ba368b171a7605f5aa690f2d516e3c834b4fc0e60e
BLAKE2b-256 checksum
How to use checksums
88f7dfa3e6c9671201ca5f06d79ff19090c4da74b6f46c0f381877f987110058
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/29.0 requests/2.25.0 requests-toolbelt/0.9.1 urllib3/1.26.3 tqdm/4.59.0 importlib-metadata/4.11.1 keyring/23.0.0 rfc3986/1.4.0 colorama/0.4.4 CPython/3.7.9

Security for sci-dl 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page