Skip to main content

Get and analyze all PLOS articles

Project description

Build Status

All of Plos (allofplos)

Copyright (c) 2017, Public Library of Science. MIT License, see LICENSE.txt for more information.

Why allofplos?

This is for downloading/updating/maintaining a repository of all PLOS XML article files. This can be used to have a copy of the PLOS text corpus for further analysis. Use this program to download all PLOS XML article files instead of doing web scraping.

NOTE: This software is not stable, we consider it beta state and will be in this stage until version 1.0. This means that programming interface may change and after a new version a full corpus download may be required.

Installation instructions

This program requires Python 3.4+.

Make a virtual environment:

$ virtualenv allofplos

Using pip:

(allofplos)$ pip install allofplos

This should install allofplos and requirements. At this stage you are ready to go.

If you want to manually install from source (for example for development purposes), first clone the proyect repository:

(allofplos)$ git clone git@github.com:PLOS/allofplos.git

Install Python dependencies inside the newly created virtual environment:

(allofplos)$ pip install -r requirements.txt

How to run the program

Execute the following command.

(allofplos)$ python -m allofplos.plos_corpus

The first time it runs it will download a >4.4 Gb zip file (allofplos_xml.zip) with all the XML files inside. Note: Make sure that you have enough space in your device for the zip file and for it content before running this command (at least 30Gb). After this file is downloaded, it will extract it contents into allofplos_xml directory inside your installation of allofplos.

If you want to see the directory on your file system where this is installed run

python -c "from allofplos.plos_regex import corpusdir; print(corpusdir)"

If you ever downloaded the corpus before, it will make an incremental update to the existing corpus, the script checks for and then downloads to a temporary folder:

  • individual new articles that have been published

  • of those new articles, checks whether they are corrections (and whether the linked corrected article has been updated)

  • checks whether there are VORs (Versions of Record) for uncorrected proofs in the main articles directory & downloads those

  • checks whether the newly downloaded articles are uncorrected proofs or not after all of these checks, it moves the new articles into the main articles folder.

Here’s what the print statements might look like on a typical run:

147 new articles to download.
147 new articles downloaded.
3 corrected articles found.
0 corrected articles downloaded with new xml.
Creating new text list of uncorrected proofs from scratch.
No new VOR articles indexed in Solr.
17 VOR articles directly downloaded.
17 uncorrected proofs updated to version of record. 44 uncorrected proofs remaining in uncorrected proof list.
9 uncorrected proofs found. 53 total in list.
Corpus started with 219792 articles.
Moving new and updated files...
164 files moved. Corpus now has 219939 articles.

How to run the tests

If you have pytest installed, from anywhere in the allofplos directory, run:

(allofplos)$ pytest

If you do not have pytest installed, from the top-level project directory, run:

(allofplos)$ python -m allofplos.tests.test_unittests

Should return something like this:

......
----------------------------------------------------------------------
Ran 6 tests in 3.327s

OK

Community guidelines

If you wish to contribute to this project please open a ticket in the GitHub repo at https://github.com/PLOS/allofplos/issues. For support requests write to mining@plos.org

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

allofplos-0.10.2.tar.gz (3.4 MB view details)

Uploaded Source

Built Distribution

allofplos-0.10.2-py3-none-any.whl (3.5 MB view details)

Uploaded Python 3

File details

Details for the file allofplos-0.10.2.tar.gz.

File metadata

  • Download URL: allofplos-0.10.2.tar.gz
  • Upload date:
  • Size: 3.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for allofplos-0.10.2.tar.gz
Algorithm Hash digest
SHA256 e123c3e27fcc8df778bbec7ee7c8c62e504451feddfd3c85de540b5074900d7a
MD5 e2e1665c50130ec0f32a27685a505ccb
BLAKE2b-256 e208be783d3d65498e952f1ba0c9eea82e81dd1d972989588a83e670ecbab6f3

See more details on using hashes here.

File details

Details for the file allofplos-0.10.2-py3-none-any.whl.

File metadata

File hashes

Hashes for allofplos-0.10.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e7973cb098b1880699914e0e1f97b41574a56b4621dc81a606a56555759fade8
MD5 4f9dd042e4fb5a899cdc1e7aa0873528
BLAKE2b-256 4b264d15892f58a1a41146c1a36281eb7f26aafac614c40d3aebf06911b66b36

See more details on using hashes here.

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