Skip to main content

Download paper PDFs from Libgen using a DOI

Project description

doi-fetcher

A minimal Python package and CLI to download paper PDFs from Libgen using a DOI.

Install

pip install doi-fetcher

CLI

# Download to the current directory (filename derived from DOI)
doi-fetcher 10.1006/viro.1998.9547

# Set output directory and filename
doi-fetcher 10.1006/viro.1998.9547 --output-dir ./papers --filename viro-1998.pdf

# Provide a full output path
doi-fetcher 10.1006/viro.1998.9547 -o /tmp/viro.pdf

# Use a specific mirror
doi-fetcher 10.1006/viro.1998.9547 --mirror li

Options:

  • -o, --output Full output path. Overrides --output-dir and --filename.
  • --output-dir Directory to save the PDF (default: current directory).
  • --filename Filename to use (default: derived from DOI).
  • --mirror Libgen mirror suffix (e.g. li) or full URL.
  • --fallback-mirror Additional mirror suffix or URL to try if the primary fails. Can be used multiple times.
  • --no-fallback Disable fallback mirrors.
  • --timeout Request timeout in seconds (default: 60).

Python usage

from doi_fetcher import fetch_pdf_by_doi, DoiFetcher

# Simple helper
path = fetch_pdf_by_doi("10.1006/viro.1998.9547", output_dir="papers")

# Reusable fetcher
fetcher = DoiFetcher(mirror="li")
path = fetcher.fetch("10.1006/viro.1998.9547", output_path="paper.pdf")

Notes:

  • The DOI can also be provided as a DOI URL (e.g. https://doi.org/...).
  • If multiple results exist, the first PDF result is downloaded.

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

doi_fetcher-0.1.3.tar.gz (6.9 kB view details)

Uploaded Source

Built Distribution

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

doi_fetcher-0.1.3-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file doi_fetcher-0.1.3.tar.gz.

File metadata

  • Download URL: doi_fetcher-0.1.3.tar.gz
  • Upload date:
  • Size: 6.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for doi_fetcher-0.1.3.tar.gz
Algorithm Hash digest
SHA256 8015ac386eff9b8ba2a5390a8440a1203f6e067a183938fb1373693d44305973
MD5 58e38300bf2fd022d416cf56a29df897
BLAKE2b-256 a0c345add0560ad1ac8e3cef48bac281f85a9385ccfadffced9ceca3e6e7adb9

See more details on using hashes here.

Provenance

The following attestation bundles were made for doi_fetcher-0.1.3.tar.gz:

Publisher: publish.yml on nicoaira/doi-fetcher

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

File details

Details for the file doi_fetcher-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: doi_fetcher-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for doi_fetcher-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 4b8df22822f964b5b6b92213376619ace87292257091abeb670a50a8204c5597
MD5 8bb95797495f0e73ee7e840a68feaea2
BLAKE2b-256 288acac759dcc0ec76f72ee59c0de89da8fb441789322ce497a6715db37e6916

See more details on using hashes here.

Provenance

The following attestation bundles were made for doi_fetcher-0.1.3-py3-none-any.whl:

Publisher: publish.yml on nicoaira/doi-fetcher

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