API - MOS Elements

This part of the module provides a collection of classes used to provide easy access to certain elements within a MosFile object, such as a list of stories within a running order, and the items within a story.

Although usually not required directly, the MOS Element classes can be imported as follows:

from mosromgr.moselements import Story

Element classes

Story

class mosromgr.moselements.Story[source]

Bases: mosromgr.moselements.MosElement

This class represents a Story element within any MosFile object, providing data relating to the story. The Story ID, Story slug, duration and more are exposed as properties, and the parent XML element is provided for further introspection.

__str__()

The XML string

property duration

The story duration (the sum of the text time and media time found within mosExternalMetadata->mosPayload), in seconds (float)

property end_time

The transmission end time of the story (datetime.datetime or None if not available in the XML)

property id

The Story ID (str)

property items

List of Item elements found within the story (can be None if not available in the XML)

property offset

The time offset of the story in seconds (float or None if not available in the XML)

property slug

The Story slug (str or None if not available in the XML)

property start_time

The transmission start time of the story (datetime.datetime or None if not available in the XML)

property xml

The parent XML element (xml.etree.ElementTree.Element)

Item

class mosromgr.moselements.Item[source]

Bases: mosromgr.moselements.MosElement

This class represents an Item element within any MosFile object, providing data relating to the item within a Story. The Item ID and Item slug are exposed as properties, and the parent XML element is provided for further introspection.

__str__()

The XML string

property id

The Item ID (str)

property note

The item note text (str or None if not found)

property slug

The Item slug (str or None if not available in the XML)

property xml

The parent XML element (xml.etree.ElementTree.Element)

Base classes

MosElement

class mosromgr.moselements.MosElement[source]

Abstract base class for MOS elements

__str__()[source]

The XML string

property id

The element ID (str)

property slug

The element slug (str or None if not available in the XML)

property xml

The parent XML element (xml.etree.ElementTree.Element)