Query sub-module

class marcxml_parser.query.MARCXMLQuery(xml=None, resort=True)[source]

Bases: marcxml_parser.serializer.MARCXMLSerializer

This class defines highlevel getters over MARC XML / OAI records.

get_name(*args, **kwargs)[source]
Returns:Name of the book.
Return type:str
Raises:KeyError – When name is not specified.
get_subname(*args, **kwargs)[source]
Parameters:undefined (optional) – Argument, which will be returned if the subname record is not found.
Returns:Subname of the book or undefined if subname is not found.
Return type:str
get_price(*args, **kwargs)[source]
Parameters:undefined (optional) – Argument, which will be returned if the price record is not found.
Returns:Price of the book (with currency) or undefined if price is not found.
Return type:str
get_part(*args, **kwargs)[source]
Parameters:undefined (optional) – Argument, which will be returned if the part record is not found.
Returns:Which part of the book series is this record or undefined if part is not found.
Return type:str
get_part_name(*args, **kwargs)[source]
Parameters:undefined (optional) – Argument, which will be returned if the part_name record is not found.
Returns:Name of the part of the series. or undefined if part_name is not found.
Return type:str
get_publisher(*args, **kwargs)[source]
Parameters:undefined (optional) – Argument, which will be returned if the publisher record is not found.
Returns:Name of the publisher (“Grada” for example) or undefined if publisher is not found.
Return type:str
get_pub_date(undefined='')[source]
Parameters:undefined (optional) – Argument, which will be returned if the pub_date record is not found.
Returns:Date of publication (month and year usually) or undefined if pub_date is not found.
Return type:str
get_pub_order(*args, **kwargs)[source]
Parameters:undefined (optional) – Argument, which will be returned if the pub_order record is not found.
Returns:Information about order in which was the book published or undefined if pub_order is not found.
Return type:str
get_pub_place(*args, **kwargs)[source]
Parameters:undefined (optional) – Argument, which will be returned if the pub_place record is not found.
Returns:Name of city/country where the book was published or undefined if pub_place is not found.
Return type:str
get_format(*args, **kwargs)[source]
Parameters:undefined (optional) – Argument, which will be returned if the format record is not found.
Returns:
Dimensions of the book (‘23 cm‘ for example) or
undefined if format is not found.
Return type:str
get_authors()[source]
Returns:Authors represented as Person objects.
Return type:list
get_corporations(roles=['dst'])[source]
Parameters:roles (list, optional) – Specify which types of corporations you need. Set to ["any"] for any role, ["dst"] for distributors, etc..
Returns:Corporation objects specified by roles parameter.
Return type:list
get_distributors()[source]
Returns:Distributors represented as Corporation object.
Return type:list
get_invalid_ISBNs()[source]

Get list of invalid ISBN (020z).

Returns:List with INVALID ISBN strings.
Return type:list
get_ISBNs()[source]

Get list of VALID ISBN.

Returns:List with valid ISBN strings.
Return type:list
get_invalid_ISSNs()[source]

Get list of invalid ISSNs (022z + 022y).

Returns:List with INVALID ISSN strings.
Return type:list
get_ISSNs()[source]

Get list of VALID ISSNs (022a).

Returns:List with valid ISSN strings.
Return type:list
get_linking_ISSNs()[source]

Get list of linking ISSNs (022l).

Returns:List with linking ISSN strings.
Return type:list
get_binding()[source]
Returns:Array of strings with bindings (["brož."]) or blank list.
Return type:list
get_originals()[source]
Returns:List of strings with names of original books (names of books in original language, before translation).
Return type:list
get_urls()[source]

Content of field 856u42. Typically URL pointing to producers homepage.

Returns:List of URLs defined by producer.
Return type:list
get_internal_urls()[source]

URL’s, which may point to edeposit, aleph, kramerius and so on.

Fields 856u40, 998a and URLu.

Returns:List of internal URLs.
Return type:list
get_pub_type()[source]
Returns:PublicationType enum value.
Return type:PublicationType
is_monographic()[source]
Returns:True if the record is monographic.
Return type:bool
is_multi_mono()[source]
Returns:True if the record is multi_mono.
Return type:bool
is_continuing()[source]
Returns:True if the record is continuing.
Return type:bool
is_single_unit()[source]
Returns:True if the record is single unit.
Return type:bool
__getitem__(item)[source]

Query inteface shortcut for MARCXMLParser.get_ctl_fields() and MARCXMLParser.get_subfields().

First three characters are considered as datafield, next character as subfield and optionaly, two others as i1 / i2 parameters.

Returned value is str/None in case of len(item) == 3 (ctl_fields) or list (or blank list) in case of len(item) >= 4.

Returns:See MARCXMLParser.get_subfields() for details, or None in case that nothing was found.
Return type:list/str
get(item, alt=None)[source]

Standard dict-like .get() method.

Parameters:
  • item (str) – See __getitem__() for details.
  • alt (default None) – Alternative value, if item is not found.
Returns:

item or alt, if item is not found.

Return type:

obj