ocrd_models.utils module

Utilities for ocrd_models

ocrd_models.utils.extract_mets_from_oai_content(data, preamble='<?xml version="1.0" encoding="UTF-8"?>')[source]

Extract METS from an OAI-PMH GetRecord response

ocrd_models.utils.handle_oai_response(response)[source]

In case of a valid OAI-Response, extract first METS-Entry-Data

ocrd_models.utils.is_oai_content(data)[source]

Return True if data is an OAI-PMH request/response

ocrd_models.utils.xmllint_format(xml)[source]

Pretty-print XML like xmllint does.

Parameters

xml (string) – Serialized XML