Skip to main content

Tool for harvesting Trove digitised newspaper articles.

Project description

TroveHarvester

This is a tool for harvesting large quantities of digitised newspaper articles from Trove.

It has been tested on MacOS and Windows 7, and should work ok with Python 3.

Installation options

No installation required!

If you want to use the harvester without installing anything, just head over to the Trove Newspaper Harvester section in my GLAM Workbench.

Installation via pip

Assuming you have Python 3 installed just:

    $ python3 -m venv mytroveharvests
    $ cd mytroveharvests
    $ source bin/activate
    $ pip install troveharvester

Basic usage

Before you do any harvesting you need to get yourself a Trove API key.

There are three basic commands:

  • start -- start a new harvest
  • restart -- restart a stalled harvest
  • report -- view harvest details

Start a harvest

To start a new harvest you can just do:

    $ cd mytroveharvests
    $ source bin/activate
    $ troveharvester start "[Trove query]" [Trove API key]

Or on Windows:

    > cd mytroveharvests
    > Scripts\activate
    > troveharvester start "[Trove query]" [Trove API key]

The Trove query can either be a url copy and pasted from a search in the Trove web interface, or a Trove API query url constructed using something like the Trove API Console. Enclose the url in double quotes.

A data directory will be automatically created to hold all of your harvests. Each harvest will be saved into a directory named with a current timestamp. Details of harvested articles are written to a CSV file named results.csv. The harvest configuration details are also saved to a metadata.json file.

Options:

--max [integer] specify a maximum number of articles to harvest (multiples of 20)

--pdf save a copy of each each as a PDF (this makes the harvest a lot slower as you have to allow a couple of seconds for each PDF to generate)

--text save the OCRd text of each article into a separate .txt file

--image save an image of each article into a separate .jpg file (if the article is split over more than one page there will be multiple images)

--include_linebreaks preserve linebreaks in saved text files

Restart a harvest

Things go wrong and harvests get interrupted. If your harvest stops before it should, you can just do:

    $ troveharvester restart

By default the script will try to restart the most recent harvest. You can also restart an earlier harvest:

    $ troveharvester restart --harvest [harvest timestamp]

Get a summary of a harvest

If you'd like to quickly check the status of a harvest, just try:

    $ troveharvester report

By default the script will report on the most recent harvest. You can get a summary for an earlier harvest:

    $ troveharvester report --harvest [harvest timestamp]

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

troveharvester-0.4.0.tar.gz (13.9 kB view details)

Uploaded Source

Built Distribution

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

troveharvester-0.4.0-py3-none-any.whl (13.1 kB view details)

Uploaded Python 3

File details

Details for the file troveharvester-0.4.0.tar.gz.

File metadata

  • Download URL: troveharvester-0.4.0.tar.gz
  • Upload date:
  • Size: 13.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.5

File hashes

Hashes for troveharvester-0.4.0.tar.gz
Algorithm Hash digest
SHA256 6d6d8ffd004ac1d76803467b40a863e359475d282f46b6f01db40f49e8ca4960
MD5 93d8d39206aeef935f4e2d1318bb8056
BLAKE2b-256 a6950a8707821496be1c452e5947d31059a36a5251dbe787e4642d3112003a95

See more details on using hashes here.

File details

Details for the file troveharvester-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: troveharvester-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 13.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.53.0 CPython/3.8.5

File hashes

Hashes for troveharvester-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 38e1ae5f792c8562227d3aaa1c911feb6632a69d7823300a60c5f5f5ab6059b7
MD5 74024447ac5cf9b011d4e27fdc02e4c0
BLAKE2b-256 8e7d53ecc7c4a0592fa6d912bfa9f92b653954a6996ad41c72681e8b98421334

See more details on using hashes here.

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