dhlab.metadata.natbib

Tools for querying the Norwegian National Bibliography Marc 21

Module Contents

Functions

_api_call_deco

Decorator for calling a service from DH-lab API

metadata_query

Query the Norwegian National Bibliography using Marc 21 fields and values

metadata_from_urn

Gets MARC 21 json for a URN or list of URN

pretty_print_marc21json

Prints a record from the Norwegian National Bibliography in a readable format

API

dhlab.metadata.natbib._api_call_deco(service: str)

Decorator for calling a service from DH-lab API

dhlab.metadata.natbib.metadata_query(conditions: List[list], limit: Optional[int] = 5) dict

Query the Norwegian National Bibliography using Marc 21 fields and values

Examples: >>> conditions = [[“245”, “a”, “kongen”],[“008”, “”, “nno”]] >>> metadata_query(conditions, limit=5)

Args: conditions: Marc 21 fields and values to search for limit: number of records to return.

Returns: a dict of the input parameters

dhlab.metadata.natbib.metadata_from_urn(urns: list, fields: Optional[list] = None) dict

Gets MARC 21 json for a URN or list of URN

Args: urns: list of URNs fields: list of marc 21 fields to return

Returns: API call parameters

dhlab.metadata.natbib.pretty_print_marc21json(record: dict)

Prints a record from the Norwegian National Bibliography in a readable format

Args: record: Marc 21 record in json format