Skip to main content

Trove query parser

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

The second parameter to parse_query is the Trove API version number. The default is 2 for backwards compatibility.

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', 3)
{'q': 'wragge',
 'l-artType': 'newspapers',
 'l-state': ['Queensland'],
 'l-category': ['Article'],
 'l-illustrated': 'true',
 'l-illustrationType': ['Cartoon'],
 'category': 'newspaper'}

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.


Created by Tim Sherratt (@wragge) for the GLAM Workbench.

Metadata

Release files for trove-query-parser 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for trove-query-parser 0.2.1
File Size Uploaded
trove_query_parser-0.2.1.tar.gz 7.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for trove-query-parser 0.2.1
File Interpreter ABI Platform
trove_query_parser-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 12.8 kB

Release files / trove_query_parser-0.2.1.tar.gz

Download URL trove_query_parser-0.2.1.tar.gz
Size 7.6 kB
Tags Source
SHA-256 checksum
How to use checksums
9ebbc2d8946a9c9218f5c3a74239ea326c3e13117d8f5f59a7927ce877c35028
BLAKE2b-256 checksum
How to use checksums
569075efdc41bea4906cdfbc67787f105b1900fa63b4ac8142dfa35efb373b5f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.12

Release files / trove_query_parser-0.2.1-py3-none-any.whl

Download URL trove_query_parser-0.2.1-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
fe28fe35ab58ccf90cb6471bace67ea9502f23a99cde83d6739449f023f34997
BLAKE2b-256 checksum
How to use checksums
d7d6ed0a5fb8067f3bad1a554ee4f298f4125749f839829ae5acd494003d91e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.12

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page