API - MOS Types

This part of the module provides the classes required for classifying and managing MOS files.

MOS Type classes are typically imported like so:

from mosromgr.mostypes import MosFile

MOS objects are constructed using one of three classmethods. Either from a file path:

ro = RunningOrder.from_file('roCreate.mos.xml')

from an XML string:

with open('roCreate.mos.xml') as f:
    xml = f.read()

ro = RunningOrder.from_string(xml)

or from an S3 file key:

ro = RunningOrder.from_s3(bucket_name='newsnight', mos_file_key='20200101/roCreate.mos.xml')

Similarly, objects constructed using these classmethods on the MosFile base class will be automatically classified and an instance of the relevant class will be created:

>>> ro = MosFile.from_file('roCreate.mos.xml')
>>> ro
<RunningOrder 1000>
>>> ss = MosFile.from_file('roStorySend.mos.xml')
>>> ss
<StorySend 1001>
>>> ro = MosFile.from_string(xml1)
>>> ro
<RunningOrder 1000>
>>> ss = MosFile.from_string(xml2)
>>> ss
<StorySend 1001>

Even roElementAction files, which require a number of different subclasses, can be classified this way:

>>> ea1 = MosFile.from_file('roElementAction1.mos.xml')
>>> ea1
<EAStorySwap 1012>
>>> ea2 = MosFile.from_string(xml)
>>> ea2
<EAItemMove 1013>

MOS message classes

The following classes are used to parse and manage specific types of MOS messages.

RunningOrder

class mosromgr.mostypes.RunningOrder[source]

Bases: mosromgr.mostypes.MosFile

A RunningOrder object is created from a roCreate MOS file and can be constructed using classmethods from_file(), from_string() or from_s3().

Specification: Create Running Order http://mosprotocol.com/wp-content/MOS-Protocol-Documents/MOSProtocolVersion40/index.html#calibre_link-32

__add__(other)[source]

RunningOrder objects can be merged with other MOS files which implement a merge method by using the + operator, for example:

ro = RunningOrder.from_file('roCreate.mos.xml')
ss = StorySend.from_file('roStorySend.mos.xml')
ro += ss
__gt__(other)

Sort by message_id i.e. ss > ro or sorted([ro, ss])

__lt__(other)

Sort by message_id i.e. ro < ss or sorted([ro, ss])

__str__()

The XML string of the MOS file

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property completed

Whether or not the running order has had a RunningOrderEnd merged (bool)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property duration

Total running order duration in seconds (int)

property end_time

Transmission end time (datetime.datetime)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property ro_slug

The running order slug (str)

property start_time

Transmission start time (datetime.datetime)

property stories

A list of Story objects within the running order

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

StorySend

class mosromgr.mostypes.StorySend[source]

Bases: mosromgr.mostypes.MosFile

A StorySend object is created from a roStorySend MOS file and can be constructed using classmethods from_file(), from_string() or from_s3().

StorySend objects can be merged with a RunningOrder by using the + operator. This behaviour is defined in the merge() method in this class.

Specification: Send Story information, including Body of the Story http://mosprotocol.com/wp-content/MOS-Protocol-Documents/MOSProtocolVersion40/index.html#calibre_link-49

__gt__(other)

Sort by message_id i.e. ss > ro or sorted([ro, ss])

__lt__(other)

Sort by message_id i.e. ro < ss or sorted([ro, ss])

__str__()

The XML string of the MOS file

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

merge(ro)[source]

Merge into the RunningOrder object provided.

Replaces the story tag in the running order with the one in the roStorySend message.

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property story

The Story object being sent

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

StoryReplace

class mosromgr.mostypes.StoryReplace[source]

Bases: mosromgr.mostypes.MosFile

A StoryReplace object is created from a roStoryReplace MOS file and can be constructed using classmethods from_file(), from_string() or from_s3().

StoryReplace objects can be merged with a RunningOrder by using the + operator. This behaviour is defined in the merge() method in this class.

Specification: Replace a Story with Another in a Running Order http://mosprotocol.com/wp-content/MOS-Protocol-Documents/MOS_Protocol_Version_2.8.5_Final.htm#roStoryReplace

__gt__(other)

Sort by message_id i.e. ss > ro or sorted([ro, ss])

__lt__(other)

Sort by message_id i.e. ro < ss or sorted([ro, ss])

__str__()

The XML string of the MOS file

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

merge(ro)[source]

Merge into the RunningOrder object provided.

Replaces the story tag in the running order with the one in the roStoryReplace message.

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property source_story

The replacement Story object

property target_story

The Story object being replaced

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

StoryInsert

class mosromgr.mostypes.StoryInsert[source]

Bases: mosromgr.mostypes.MosFile

A StoryInsert object is created from a roStoryInsert MOS file and can be constructed using classmethods from_file(), from_string() or from_s3().

StoryInsert objects can be merged with a RunningOrder by using the + operator. This behaviour is defined in the merge() method in this class.

Specification: Insert Stories in Running Order http://mosprotocol.com/wp-content/MOS-Protocol-Documents/MOS_Protocol_Version_2.8.5_Final.htm#roStoryInsert

__gt__(other)

Sort by message_id i.e. ss > ro or sorted([ro, ss])

__lt__(other)

Sort by message_id i.e. ro < ss or sorted([ro, ss])

__str__()

The XML string of the MOS file

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

merge(ro)[source]

Merge into the RunningOrder object provided.

Inserts the story tags from the roStoryInsert message into the running order.

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property source_stories

A list of Story objects to be inserted

property target_story

The Story object above which the source stories are to be inserted

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

StoryAppend

class mosromgr.mostypes.StoryAppend[source]

Bases: mosromgr.mostypes.MosFile

A StoryAppend object is created from a roStoryAppend MOS file and can be constructed using classmethods from_file(), from_string() or from_s3().

StoryAppend objects can be merged with a RunningOrder by using the + operator. This behaviour is defined in the merge() method in this class.

Specification: Append Stories to Running Order http://mosprotocol.com/wp-content/MOS-Protocol-Documents/MOS_Protocol_Version_2.8.5_Final.htm#roStoryAppend

__gt__(other)

Sort by message_id i.e. ss > ro or sorted([ro, ss])

__lt__(other)

Sort by message_id i.e. ro < ss or sorted([ro, ss])

__str__()

The XML string of the MOS file

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

merge(ro)[source]

Merge into the RunningOrder object provided.

Adds the story tag in the roStoryAppend message onto the end of the running order.

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property stories

A list of Story objects to be appended

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

StoryMove

class mosromgr.mostypes.StoryMove[source]

Bases: mosromgr.mostypes.MosFile

A StoryMove object is created from a roStoryMove MOS file and can be constructed using classmethods from_file(), from_string() or from_s3().

StoryMove objects can be merged with a RunningOrder by using the + operator. This behaviour is defined in the merge() method in this class.

Specification: Move a story to a new position in the Playlist http://mosprotocol.com/wp-content/MOS-Protocol-Documents/MOS_Protocol_Version_2.8.5_Final.htm#roStoryMove

__gt__(other)

Sort by message_id i.e. ss > ro or sorted([ro, ss])

__lt__(other)

Sort by message_id i.e. ro < ss or sorted([ro, ss])

__str__()

The XML string of the MOS file

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

merge(ro)[source]

Merge into the RunningOrder object provided.

Moves the story given in the roStoryMove message to a new position in the running order.

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property source_story

The Story object to be moved

property target_story

The Story object above which the source story is to be moved

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

StoryDelete

class mosromgr.mostypes.StoryDelete[source]

Bases: mosromgr.mostypes.MosFile

A StoryDelete object is created from a roStoryDelete MOS file and can be constructed using classmethods from_file(), from_string() or from_s3().

StoryDelete objects can be merged with a RunningOrder by using the + operator. This behaviour is defined in the merge() method in this class.

Specification: Delete Stories from Running Order http://mosprotocol.com/wp-content/MOS-Protocol-Documents/MOS_Protocol_Version_2.8.5_Final.htm#roStoryDelete

__gt__(other)

Sort by message_id i.e. ss > ro or sorted([ro, ss])

__lt__(other)

Sort by message_id i.e. ro < ss or sorted([ro, ss])

__str__()

The XML string of the MOS file

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

merge(ro)[source]

Merge into the RunningOrder object provided.

Removes any story tags from the running order which are included in the roStoryDelete message.

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property stories

A list of Story objects to be deleted

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

MetaDataReplace

class mosromgr.mostypes.MetaDataReplace[source]

Bases: mosromgr.mostypes.MosFile

A MetaDataReplace object is created from a roMetadataReplace MOS file and can be constructed using classmethods from_file(), from_string() or from_s3().

MetaDataReplace objects can be merged with a RunningOrder by using the + operator. This behaviour is defined in the merge() method in this class.

Specification: Replace RO metadata without deleting the RO structure http://mosprotocol.com/wp-content/MOS-Protocol-Documents/MOSProtocolVersion40/index.html#calibre_link-34

__gt__(other)

Sort by message_id i.e. ss > ro or sorted([ro, ss])

__lt__(other)

Sort by message_id i.e. ro < ss or sorted([ro, ss])

__str__()

The XML string of the MOS file

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

merge(ro)[source]

Merge into the RunningOrder object provided.

Replaces the metadata tags in the running order with the ones in the MetaDataReplace message.

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property ro_slug

The running order slug (str)

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

ItemDelete

class mosromgr.mostypes.ItemDelete[source]

Bases: mosromgr.mostypes.MosFile

An ItemDelete object is created from a roItemDelete MOS file and can be constructed using classmethods from_file(), from_string() or from_s3().

ItemDelete objects can be merged with a RunningOrder by using the + operator. This behaviour is defined in the merge() method in this class.

Specification: Delete Items in Story http://mosprotocol.com/wp-content/MOS-Protocol-Documents/MOS_Protocol_Version_2.8.5_Final.htm#roItemDelete

__gt__(other)

Sort by message_id i.e. ss > ro or sorted([ro, ss])

__lt__(other)

Sort by message_id i.e. ro < ss or sorted([ro, ss])

__str__()

The XML string of the MOS file

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

merge(ro)[source]

Merge into the RunningOrder object provided.

Deletes any item tags with the IDs specified in the roItemDelete message from the running order.

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property target_items

The Item objects being deleted

property target_story

The Story object containing the items being replaced

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

ItemInsert

class mosromgr.mostypes.ItemInsert[source]

Bases: mosromgr.mostypes.MosFile

An ItemInsert object is created from a roItemInsert MOS file and can be constructed using classmethods from_file(), from_string() or from_s3().

ItemInsert objects can be merged with a RunningOrder by using the + operator. This behaviour is defined in the merge() method in this class.

Specification: Insert Items in Story http://mosprotocol.com/wp-content/MOS-Protocol-Documents/MOS_Protocol_Version_2.8.5_Final.htm#roItemInsert

__gt__(other)

Sort by message_id i.e. ss > ro or sorted([ro, ss])

__lt__(other)

Sort by message_id i.e. ro < ss or sorted([ro, ss])

__str__()

The XML string of the MOS file

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

merge(ro)[source]

Merge into the RunningOrder object provided.

Inserts the item tags from the roItemInsert message into the relevant story in the running order.

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property source_items

A list of Item objects to be inserted

property target_item

The Item object above which the source items will be inserted

property target_story

The Story object into which the items are to be inserted

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

ItemMoveMultiple

class mosromgr.mostypes.ItemMoveMultiple[source]

Bases: mosromgr.mostypes.MosFile

An ItemMoveMultiple object is created from a roItemMoveMultiple MOS file and can be constructed using classmethods from_file(), from_string() or from_s3().

ItemMoveMultiple objects can be merged with a RunningOrder by using the + operator. This behaviour is defined in the merge() method in this class.

Specification: Move one or more Items to a specified position within a Story http://mosprotocol.com/wp-content/MOS-Protocol-Documents/MOS_Protocol_Version_2.8.5_Final.htm#roItemMoveMultiple

__gt__(other)

Sort by message_id i.e. ss > ro or sorted([ro, ss])

__lt__(other)

Sort by message_id i.e. ro < ss or sorted([ro, ss])

__str__()

The XML string of the MOS file

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

merge(ro)[source]

Merge into the RunningOrder object provided.

Moves item tags in the roItemMove message to a new position within the story.

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property source_items

A list of Item objects to be moved

property target_item

The Item object above which the source items will be moved

property target_story

The Story object containing the items being moved

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

ItemReplace

class mosromgr.mostypes.ItemReplace[source]

Bases: mosromgr.mostypes.MosFile

An ItemReplace object is created from a roItemReplace MOS file and can be constructed using classmethods from_file(), from_string() or from_s3().

ItemReplace objects can be merged with a RunningOrder by using the + operator. This behaviour is defined in the merge() method in this class.

Specification: Replace an Item with one or more Items in a Story http://mosprotocol.com/wp-content/MOS-Protocol-Documents/MOS_Protocol_Version_2.8.5_Final.htm#roItemReplace

__gt__(other)

Sort by message_id i.e. ss > ro or sorted([ro, ss])

__lt__(other)

Sort by message_id i.e. ro < ss or sorted([ro, ss])

__str__()

The XML string of the MOS file

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

merge(ro)[source]

Merge into the RunningOrder object provided.

Replaces the story tag in the running order with the one in the roStorySend message

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property source_items

A list of replacement Item objects

property target_item

The Item object being replaced

property target_story

The Story object containing the item being replaced

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

ReadyToAir

class mosromgr.mostypes.ReadyToAir[source]

Bases: mosromgr.mostypes.MosFile

A ReadyToAir object is created from a roReadyToAir MOS file and can be constructed using classmethods from_file(), from_string() or from_s3().

ReadyToAir objects can be merged with a RunningOrder by using the + operator. This behaviour is defined in the merge() method in this class.

Specification: Identify a Running Order as Ready to Air http://mosprotocol.com/wp-content/MOS-Protocol-Documents/MOSProtocolVersion40/index.html#calibre_link-41

__gt__(other)

Sort by message_id i.e. ss > ro or sorted([ro, ss])

__lt__(other)

Sort by message_id i.e. ro < ss or sorted([ro, ss])

__str__()

The XML string of the MOS file

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

merge(ro)[source]

Merge into the RunningOrder object provided.

Currently unimplemented - has no effect on the running order. TODO: #18

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

EAStoryReplace

class mosromgr.mostypes.EAStoryReplace[source]

Bases: mosromgr.mostypes.ElementAction

An EAStoryReplace object is created from a roElementAction MOS file containing a story replacement, and can be constructed using classmethods from_file(), from_string() or from_s3().

EAStoryReplace objects can be merged with a RunningOrder by using the + operator. This behaviour is defined in the merge() method in this class.

Specification: Replacing a story http://mosprotocol.com/wp-content/MOS-Protocol-Documents/MOSProtocolVersion40/index.html#calibre_link-43

__gt__(other)

Sort by message_id i.e. ss > ro or sorted([ro, ss])

__lt__(other)

Sort by message_id i.e. ro < ss or sorted([ro, ss])

__str__()

The XML string of the MOS file

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

merge(ro)[source]

Merge into the RunningOrder object provided.

Replaces the element_target story tag in the running order with any story tags found in the element_source in the roElementAction message.

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property source_story

The replacement Story object

property target_story

The Story object being replaced

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

EAItemReplace

class mosromgr.mostypes.EAItemReplace[source]

Bases: mosromgr.mostypes.ElementAction

An EAItemReplace object is created from a roElementAction MOS file containing an item replacement, and can be constructed using classmethods from_file(), from_string() or from_s3().

EAItemReplace objects can be merged with a RunningOrder by using the + operator. This behaviour is defined in the merge() method in this class.

Specification: Replacing an item http://mosprotocol.com/wp-content/MOS-Protocol-Documents/MOSProtocolVersion40/index.html#calibre_link-43

__gt__(other)

Sort by message_id i.e. ss > ro or sorted([ro, ss])

__lt__(other)

Sort by message_id i.e. ro < ss or sorted([ro, ss])

__str__()

The XML string of the MOS file

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

merge(ro)[source]

Merge into the RunningOrder object provided.

Replaces the target item tag in the target story in the running order with any item tags found in the element_source in the roElementAction message.

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property source_items

A list of replacement Item objects

property target_item

The Item object being replaced

property target_story

The Story object containing the item being replaced

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

EAStoryDelete

class mosromgr.mostypes.EAStoryDelete[source]

Bases: mosromgr.mostypes.ElementAction

An EAStoryDelete object is created from a roElementAction MOS file containing a story deletion, and can be constructed using classmethods from_file(), from_string() or from_s3().

EAStoryDelete objects can be merged with a RunningOrder by using the + operator. This behaviour is defined in the merge() method in this class.

Specification: Deleting stories http://mosprotocol.com/wp-content/MOS-Protocol-Documents/MOSProtocolVersion40/index.html#calibre_link-43

__gt__(other)

Sort by message_id i.e. ss > ro or sorted([ro, ss])

__lt__(other)

Sort by message_id i.e. ro < ss or sorted([ro, ss])

__str__()

The XML string of the MOS file

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

merge(ro)[source]

Merge into the RunningOrder object provided.

Removes any stories specified in element_source in the roElementAction message from the running order.

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property stories

A list of Story objects to be deleted

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

EAItemDelete

class mosromgr.mostypes.EAItemDelete[source]

Bases: mosromgr.mostypes.ElementAction

An EAItemDelete object is created from a roElementAction MOS file containing an item deletion, and can be constructed using classmethods from_file(), from_string() or from_s3().

EAItemDelete objects can be merged with a RunningOrder by using the + operator. This behaviour is defined in the merge() method in this class.

Specification: Deleting items http://mosprotocol.com/wp-content/MOS-Protocol-Documents/MOSProtocolVersion40/index.html#calibre_link-43

__gt__(other)

Sort by message_id i.e. ss > ro or sorted([ro, ss])

__lt__(other)

Sort by message_id i.e. ro < ss or sorted([ro, ss])

__str__()

The XML string of the MOS file

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

merge(ro)[source]

Merge into the RunningOrder object provided.

Deletes any items specified in the element_target in the roStorySend message from the specified story in the running order.

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property source_items

A list of Item objects being deleted

property target_story

The Story object containing the items being deleted

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

EAStoryInsert

class mosromgr.mostypes.EAStoryInsert[source]

Bases: mosromgr.mostypes.ElementAction

An EAStoryInsert object is created from a roElementAction MOS file containing a story insertion, and can be constructed using classmethods from_file(), from_string() or from_s3().

EAStoryInsert objects can be merged with a RunningOrder by using the + operator. This behaviour is defined in the merge() method in this class.

Specification: Inserting stories http://mosprotocol.com/wp-content/MOS-Protocol-Documents/MOSProtocolVersion40/index.html#calibre_link-43

__gt__(other)

Sort by message_id i.e. ss > ro or sorted([ro, ss])

__lt__(other)

Sort by message_id i.e. ro < ss or sorted([ro, ss])

__str__()

The XML string of the MOS file

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

merge(ro)[source]

Merge into the RunningOrder object provided.

Inserts any story tags found in the element_source in the roElementAction message into the running order.

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property source_stories

The Story objects to be inserted

property target_story

The Story object above which the source story will be inserted

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

EAItemInsert

class mosromgr.mostypes.EAItemInsert[source]

Bases: mosromgr.mostypes.ElementAction

An EAItemInsert object is created from a roElementAction MOS file containing an item insertion, and can be constructed using classmethods from_file(), from_string() or from_s3().

EAItemInsert objects can be merged with a RunningOrder by using the + operator. This behaviour is defined in the merge() method in this class.

Specification: Inserting items http://mosprotocol.com/wp-content/MOS-Protocol-Documents/MOSProtocolVersion40/index.html#calibre_link-43

__gt__(other)

Sort by message_id i.e. ss > ro or sorted([ro, ss])

__lt__(other)

Sort by message_id i.e. ro < ss or sorted([ro, ss])

__str__()

The XML string of the MOS file

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

merge(ro)[source]

Merge into the RunningOrder object provided.

Inserts any item tags found in the element_source in the roElementAction message into the relevant story in the running order.

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property source_items

A list of Item objects to be inserted

property target_item

The Item object above which the source item is to be be inserted

property target_story

The Story object into which the item is to be inserted

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

EAStorySwap

class mosromgr.mostypes.EAStorySwap[source]

Bases: mosromgr.mostypes.ElementAction

An EAStorySwap object is created from a roElementAction MOS file containing a story swap, and can be constructed using classmethods from_file(), from_string() or from_s3().

EAStorySwap objects can be merged with a RunningOrder by using the + operator. This behaviour is defined in the merge() method in this class.

Specification: Swapping stories http://mosprotocol.com/wp-content/MOS-Protocol-Documents/MOSProtocolVersion40/index.html#calibre_link-43

__gt__(other)

Sort by message_id i.e. ss > ro or sorted([ro, ss])

__lt__(other)

Sort by message_id i.e. ro < ss or sorted([ro, ss])

__str__()

The XML string of the MOS file

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

merge(ro)[source]

Merge into the RunningOrder object provided.

Swaps the order of the two story tags specified in element_source in the roElementAction message in the running order.

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property stories

A set of the two Story objects to be swapped

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

EAItemSwap

class mosromgr.mostypes.EAItemSwap[source]

Bases: mosromgr.mostypes.ElementAction

An EAItemSwap object is created from a roElementAction MOS file containing an item swap, and can be constructed using classmethods from_file(), from_string() or from_s3().

EAItemSwap objects can be merged with a RunningOrder by using the + operator. This behaviour is defined in the merge() method in this class.

Specification: Swapping items http://mosprotocol.com/wp-content/MOS-Protocol-Documents/MOSProtocolVersion40/index.html#calibre_link-43

__gt__(other)

Sort by message_id i.e. ss > ro or sorted([ro, ss])

__lt__(other)

Sort by message_id i.e. ro < ss or sorted([ro, ss])

__str__()

The XML string of the MOS file

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

merge(ro)[source]

Merge into the RunningOrder object provided.

Swaps the order of the two item tags specified in element_source in the roElementAction message in the relevant story in the running order.

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property source_items

A set of Item objects to be swapped

property target_story

The Story object containing the items being swapped

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

EAStoryMove

class mosromgr.mostypes.EAStoryMove[source]

Bases: mosromgr.mostypes.ElementAction

An EAStoryMove object is created from a roElementAction MOS file containing a story move, and can be constructed using classmethods from_file(), from_string() or from_s3().

EAStoryMove objects can be merged with a RunningOrder by using the + operator. This behaviour is defined in the merge() method in this class.

Specification: Moving stories http://mosprotocol.com/wp-content/MOS-Protocol-Documents/MOSProtocolVersion40/index.html#calibre_link-43

__gt__(other)

Sort by message_id i.e. ss > ro or sorted([ro, ss])

__lt__(other)

Sort by message_id i.e. ro < ss or sorted([ro, ss])

__str__()

The XML string of the MOS file

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

merge(ro)[source]

Merge into the RunningOrder object provided.

Moves story tags in element_source to the specified location in the running order.

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property source_stories

A list of replacement Story objects

property target_story

The Story object being replaced

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

EAItemMove

class mosromgr.mostypes.EAItemMove[source]

Bases: mosromgr.mostypes.ElementAction

An EAItemMove object is created from a roElementAction MOS file containing an item move, and can be constructed using classmethods from_file(), from_string() or from_s3().

EAItemMove objects can be merged with a RunningOrder by using the + operator. This behaviour is defined in the merge() method in this class.

Specification: Moving items http://mosprotocol.com/wp-content/MOS-Protocol-Documents/MOSProtocolVersion40/index.html#calibre_link-43

__gt__(other)

Sort by message_id i.e. ss > ro or sorted([ro, ss])

__lt__(other)

Sort by message_id i.e. ro < ss or sorted([ro, ss])

__str__()

The XML string of the MOS file

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

merge(ro)[source]

Merge into the RunningOrder object provided.

Moves item tags in element_source to the specified location in the story in the running order.

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property source_item

The Item object to be moved

property target_items

A list of Item object above which the source items will be moved

property target_story

The Story object containing the item being replaced

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

RunningOrderReplace

class mosromgr.mostypes.RunningOrderReplace[source]

Bases: mosromgr.mostypes.RunningOrder

An RunningOrderReplace object is created from a roReplace MOS file and can be constructed using classmethods from_file(), from_string() or from_s3().

RunningOrderReplace objects can be merged with a RunningOrder by using the + operator. This behaviour is defined in the merge() method in this class.

Specification: Replace Running Order http://mosprotocol.com/wp-content/MOS-Protocol-Documents/MOSProtocolVersion40/index.html#calibre_link-33

__add__(other)

RunningOrder objects can be merged with other MOS files which implement a merge method by using the + operator, for example:

ro = RunningOrder.from_file('roCreate.mos.xml')
ss = StorySend.from_file('roStorySend.mos.xml')
ro += ss
__gt__(other)

Sort by message_id i.e. ss > ro or sorted([ro, ss])

__lt__(other)

Sort by message_id i.e. ro < ss or sorted([ro, ss])

__str__()

The XML string of the MOS file

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

merge(ro)[source]

Merge into the RunningOrder object provided.

Replaces the entire roCreate tag in the running order with the one in the roReplace message.

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property duration

Total running order duration in seconds (int)

property end_time

Transmission end time (datetime.datetime)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property ro_slug

The running order slug (str)

property start_time

Transmission start time (datetime.datetime)

property stories

A list of Story objects within the running order

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

RunningOrderEnd

class mosromgr.mostypes.RunningOrderEnd[source]

Bases: mosromgr.mostypes.MosFile

A RunningOrderEnd object is created from a roDelete MOS file and can be constructed using classmethods from_file(), from_string() or from_s3().

RunningOrderEnd objects can be merged with a RunningOrder by using the + operator. This behaviour is defined in the merge() method in this class. Once a RunningOrderEnd object has been merged into a RunningOrder, the running order is considered “completed” and no further messages can be merged (with the exception of RunningOrderControl).

Specification: Delete Running Order http://mosprotocol.com/wp-content/MOS-Protocol-Documents/MOSProtocolVersion40/index.html#calibre_link-35

__gt__(other)

Sort by message_id i.e. ss > ro or sorted([ro, ss])

__lt__(other)

Sort by message_id i.e. ro < ss or sorted([ro, ss])

__str__()

The XML string of the MOS file

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

merge(ro)[source]

Merge into the RunningOrder object provided.

Adds a mosromgrmeta tag containing the roDelete tag from the roDelete message to the roCreate tag in the running order.

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

RunningOrderControl

class mosromgr.mostypes.RunningOrderControl[source]

Bases: mosromgr.mostypes.MosFile

A RunningOrderControl object is created from a roCtrl MOS file and can be constructed using classmethods from_file(), from_string() or from_s3().

Specification: Running Order Control http://mosprotocol.com/wp-content/MOS-Protocol-Documents/MOSProtocolVersion40/index.html#calibre_link-47

TODO: generalise this class #20

__gt__(other)

Sort by message_id i.e. ss > ro or sorted([ro, ss])

__lt__(other)

Sort by message_id i.e. ro < ss or sorted([ro, ss])

__str__()

The XML string of the MOS file

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

merge(ro)[source]

Merge into the RunningOrder object provided.

Replaces the story tag in the running order with the one in the roStorySend message

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property story

The story to which this roCtrl message relates

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

Base classes

Since some logic is shared between MOS file management, some inheritance is used in the implementation:

_images/class_hierarchy.svg

MosFile

class mosromgr.mostypes.MosFile[source]

Base class for all MOS files

classmethod from_file(mos_file_path)[source]

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)[source]

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)[source]

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)

ElementAction

class mosromgr.mostypes.ElementAction[source]

Base class for various roElementAction MOS files

classmethod from_file(mos_file_path)

Construct from a path to a MOS file

Parameters

mos_file_path (str) – The MOS file path

classmethod from_s3(bucket_name, mos_file_key)

Construct from a MOS file in an S3 bucket

Parameters
  • bucket_name (str) – The name of the S3 bucket

  • mos_file_key (str) – A MOS file key within the S3 bucket

classmethod from_string(mos_xml_string)

Construct from an XML string of a MOS document

Parameters

mos_xml_string (str) – The XML string of the MOS document

property base_tag

The base tag (xml.etree.ElementTree.Element) within the xml, as determined by base_tag_name

property base_tag_name

The name of the base XML tag for this file type (str)

property dict

Convert XML to dictionary using xmltodict library. Useful for testing. (dict)

property message_id

The MOS file’s message ID (int)

property ro_id

The running order ID (str)

property xml

The XML element of the MOS file (xml.etree.ElementTree.Element)