There is a newer version of the record available.

Published October 27, 2021 | Version v0.1.1

wragge/trove_query_parser: v0.1.1

Authors/Creators

Description

Convert a query from the Trove web interface into a set of parameters that can be used with the Trove API.

Installation

pip install trove-query-parser

How to use

  • Construct a search in the Trove 'Newspapers and Gazettes' category.
  • Copy the search url.
  • Feed the url to the parse_query function.
from trove_query_parser.parser import parse_query

parse_query('https://trove.nla.gov.au/search/category/newspapers?keyword=wragge&l-artType=newspapers&l-state=Queensland&l-category=Article&l-illustrationType=Cartoon')
{'q': 'wragge',
 'zone': 'newspaper',
 'l-state': ['Queensland'],
 'l-category': ['Article'],
 'l-illustrated': 'true',
 'l-illtype': ['Cartoon']}

See the documentation for a more detailed example.

Limitations

Currently this only works with the 'Newspapers & Gazettes' category. Other categories may be added in time.

Files

wragge/trove_query_parser-v0.1.1.zip

Files (29.1 kB)

Name Size Download all
md5:157b03df4e8e5ebc235ab871cff72314
29.1 kB Preview Download

Additional details

Related works

Is derived from
Software: https://github.com/wragge/trove_query_parser/tree/v0.1.1 (URL)
Is documented by
Software documentation: https://wragge.github.io/trove_query_parser/ (URL)