doi-downloader
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
Command line
doi-downloader 10.1038/s41586-020-2649-2 -o downloads
doi-downloader --file dois.txt -o downloads # one DOI per line
Run doi-downloader --help for all options, and see the usage documentation for details.
Python
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:
- Install the required libraries of this repo by following the instructions under the "Install" section above.
- Ensure you have procured the relevant API keys of the plugins you use.
- 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.
- 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.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| tmsr_doi_downloader-1.1.3.tar.gz | 64.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| tmsr_doi_downloader-1.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 91.5 kB
Release files / tmsr_doi_downloader-1.1.3.tar.gz
| Download URL | tmsr_doi_downloader-1.1.3.tar.gz |
|---|---|
| Size | 64.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3f95f0e6555fcb26c2f8edf520638b7613c788a69077b12f0b53dcb02328d6c5
|
|
BLAKE2b-256 checksum How to use checksums |
dc70b69614ac5cf9c181a5002c6525eca604ec9f3c6b984a3591bd630e7306f9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|
Release files / tmsr_doi_downloader-1.1.3-py3-none-any.whl
| Download URL | tmsr_doi_downloader-1.1.3-py3-none-any.whl |
|---|---|
| Size | 27.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
62103ac5492a395eef69d797b5aa7877863dd367d457cbaa83a7221246c1b7d8
|
|
BLAKE2b-256 checksum How to use checksums |
df48b175e35cc1afd9af89291114f20537000ae51ffd3d5f585bf4bece152173
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.8
|