Skip to main content

doi-downloader

github license badge CI pre-commit.ci status

Install

git clone git@github.com:escience-tmsr/doi_downloader.git
cd doi_downloader
make virtualenv
source .venv/bin/activate
make install

Test

make test

Use

Simple example

from doi_downloader import doi_downloader as ddl

doi = "10.1038/s41586-020-2649-2"
ddl.download(doi, output_dir="downloads")

Check examples for examples of how to use.

Adding new source adapters

Create a new file in the plugins directory, and implement the Plugin class. The class should implement the following methods:

  • get_pdf_urls: This method should return the PDF URL for the given DOI.
  • fetch_metadata: This method should return the metadata for the given DOI.

Benchmarking plugin performance

This repository has code to measure, benchmark and analyse the coverage or performance of all API plugins used with doi-downloader. Performance means the ability of the plugins to find and download the PDF articles associated with a given list of DOIs (ratio of successfully downloaded PDFs to failed downloads). To run the benchmark you have to:

  1. Install the required libraries of this repo by following the instructions under the "Install" section above.
  2. Ensure you have procured the relevant API keys of the plugins you use.
  3. Add the API keys as environment variables to your operating system. Here is a useful reference for how to do this on different operating systems.
  4. Ensure you have a CSV file with two (or more) columns. One column should have a header called "doi" and hold the DOI for a paper. The second column should have a header called "domain" which holds the journal name or domain of the journal website (not URL, just the domain name) where the paper metadata can be viewed. You can then run the benchmark code using this command:

python -m benchmark.batch_download path/to/csv/file.csv

After execution, generated data for analysis can be found under benchmark/logs/... and benchmark/reports/...

To get a summary of the top performing plugins and journals run (ensure you have run the above command first):

python -m benchmark.get_top_performers

After execution, the results are written to benchmark/reports/top_performers.txt

Read the docs

Check the documentaion at https://escience-tmsr.github.io/doi-downloader/.

Metadata

Release files for tmsr-doi-downloader 1.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 tmsr-doi-downloader 1.1.2
File Size Uploaded
tmsr_doi_downloader-1.1.2.tar.gz 60.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tmsr-doi-downloader 1.1.2
File Interpreter ABI Platform
tmsr_doi_downloader-1.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 86.2 kB

Release files / tmsr_doi_downloader-1.1.2.tar.gz

Download URL tmsr_doi_downloader-1.1.2.tar.gz
Size 60.6 kB
Tags Source
SHA-256 checksum
How to use checksums
4212b843080448ce699862c6427cc14df7de97a16fc490135ef51d89fc39a4cd
BLAKE2b-256 checksum
How to use checksums
fffcf8310388df9af4681442a2de037475343e3a6932db9ddcc7764227f58270
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / tmsr_doi_downloader-1.1.2-py3-none-any.whl

Download URL tmsr_doi_downloader-1.1.2-py3-none-any.whl
Size 25.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
067f4f9fe1a7d5ca81baf548b79a961befddf0bf7f89b310706055e63dd69c72
BLAKE2b-256 checksum
How to use checksums
5767e786fbd713da0e5d98eb169cb5133698de91558b4deea073c2192ed6ebaa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

1.2.0

2 release files

1.1.3

2 release files

This release

1.1.2 This release

2 release files

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