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
orNone
if not available in the XML)
-
property
items
¶ List of
Item
elements found within the story (can beNone
if not available in the XML)
-
property
offset
¶ The time offset of the story in seconds (
float
orNone
if not available in the XML)
-
property
start_time
¶ The transmission start time of the story (
datetime.datetime
orNone
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 aStory
. 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
xml
¶ The parent XML element (
xml.etree.ElementTree.Element
)
-