DigitalInstance structure

class cz_urnnbn_api.api_structures.digital_instance.DigitalInstance(url, digital_library_id, **kwargs)

Bases: kwargs_obj.kwargs_obj.KwargsObj

Container used to hold informations about instances of the documents in digital library - this is pointer to document in digital library.

uid

str – ID of the library.

url

str – URL of the library.

digital_library_id

str – Id of the digitial library.

active

bool, def. None – Is the record active?

created

str, def. None – ISO 8601 string with date.

deactivated

str, def. None – ISO 8601 string representation of date.

format

str, def. None – Format of the book. jpg;pdf for example.

accessibility

str, def. None – Free description of accessibility.

to_xml()

Convert self to XML, which can be send to API to register new digital instance.

Returns:UTF-8 encoded string with XML representation.
Return type:str
Raises:AssertionError – If url or digital_library_id is not set.
static instance_from_xmldict(dict_tag)

Create DigitalInstance from nested dicts (result of xmltodict).

Parameters:dict_tag (dict) – Nested dicts.
Returns:DigitalInstance object.
Return type:obj
static from_xml(xml)

Parse xml string and DigitalInstances.

Parameters:xml (str) – Unicode/utf-8 XML.
Returns:List of DigitalInstance objects.
Return type:list