Socket
Book a DemoInstallSign in
Socket

trove-query-parser

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trove-query-parser

Convert search parameters from the Trove web interface into a form the API understands.

0.2.1
pipPyPI
Maintainers
1

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.

Keywords

Trove

FAQs

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.