Skip to main content

Tool for bulk harvests of digitised newspaper articles from Trove

Project description

trove-newspaper-harvester

View the full documentation

The Trove Newspaper (& Gazette) Harvester makes it easy to download large quantities of digitised articles from Trove’s newspapers and gazettes. Just give it a search from the Trove web interface, and the harvester will save the metadata of all the articles in a CSV (spreadsheet) file for further analysis. You can also save the full text of every article, as well as copies of the articles as JPG images, and even PDFs. While the web interface will only show you the first 2,000 results matching your search, the Newspaper Harvester will get everything.

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

pip install trove-newspaper-harvester

Use as a library

from trove_newspaper_harvester.core import prepare_query, Harvester

Generate a set of query parameters using prepare_query.

my_query = "https://trove.nla.gov.au/search/category/newspapers?keyword=wragge"
my_api_key = "mYSecREtkEy"

my_query_params = prepare_query(query=my_query, key=my_api_key)

Initialise the Harvester with your query parameters.

harvester = Harvester(query_params=my_query_params)

Start the harvest!

harvester.harvest()

If the harvest fails just run Harvester.harvest again.

See the core module documentation for more options and examples.

Use as a command-line tool

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:

troveharvester start "[Trove query]" [Trove API key]

The Trove query can either be a url copied 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.

See the CLI module documentation for more details.


Created by Tim Sherratt for the GLAM Workbench. Support this project by becoming a GitHub sponsor.

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

trove-newspaper-harvester-0.6.4.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

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

trove_newspaper_harvester-0.6.4-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file trove-newspaper-harvester-0.6.4.tar.gz.

File metadata

File hashes

Hashes for trove-newspaper-harvester-0.6.4.tar.gz
Algorithm Hash digest
SHA256 bae5f2ce1c5baa7f6fb6c8910528e8cdabda86632d92e17b150ddcbe2af5aa5e
MD5 7213addd31e23b07a4b43b0b8b55b456
BLAKE2b-256 06a021d51905aacf284e6f43b4907a3d0aee40ec116e386175dd17cfc87be68f

See more details on using hashes here.

File details

Details for the file trove_newspaper_harvester-0.6.4-py3-none-any.whl.

File metadata

File hashes

Hashes for trove_newspaper_harvester-0.6.4-py3-none-any.whl
Algorithm Hash digest
SHA256 8eba0cdd6f847ff564a948083f6668f5ad13fc4ac0d45925ec70c5dd08c9e766
MD5 110f6dd0df4c01b80137034a26712592
BLAKE2b-256 0cfa11af4f36ea538910f3376291ba20b802f776cf44c32fdba4e40c3246be82

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