{"id":18376927,"url":"https://github.com/bbc/mosromgr","last_synced_at":"2025-04-06T20:31:48.348Z","repository":{"id":46990556,"uuid":"283181382","full_name":"bbc/mosromgr","owner":"bbc","description":"Python library for managing MOS running orders, developed by BBC News Labs","archived":false,"fork":false,"pushed_at":"2024-12-15T23:38:42.000Z","size":5496,"stargazers_count":16,"open_issues_count":3,"forks_count":1,"subscribers_count":16,"default_branch":"main","last_synced_at":"2025-03-19T08:19:21.491Z","etag":null,"topics":["broadcasting","mos","mos-protocol","newslabs","openmedia","python","radio","running-order","tv"],"latest_commit_sha":null,"homepage":"https://mosromgr.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bbc.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-28T10:38:58.000Z","updated_at":"2025-01-07T14:06:26.000Z","dependencies_parsed_at":"2023-02-17T22:16:08.306Z","dependency_job_id":null,"html_url":"https://github.com/bbc/mosromgr","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Fmosromgr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Fmosromgr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Fmosromgr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bbc%2Fmosromgr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bbc","download_url":"https://codeload.github.com/bbc/mosromgr/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247547640,"owners_count":20956589,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["broadcasting","mos","mos-protocol","newslabs","openmedia","python","radio","running-order","tv"],"created_at":"2024-11-06T00:25:28.339Z","updated_at":"2025-04-06T20:31:47.412Z","avatar_url":"https://github.com/bbc.png","language":"Python","readme":"========\nmosromgr\n========\n\nPython library for managing `MOS`_ running orders. Pronounced *mos-ro-manager*.\n\n.. _MOS: http://mosprotocol.com/\n\n.. image:: https://mosromgr.readthedocs.io/en/latest/_images/mos.jpg\n    :target: http://mosprotocol.com/\n    :align: center\n\nThe library provides functionality for classifying MOS file types, processing and\ninspecting MOS message files, as well as merging MOS files into a running order,\nand providing a \"completed\" programme including all additions and changes made\nbetween the first message (``roCreate``) and the last (``roDelete``).\n\nThis can be used as a library, using the utilities provided in the *mosromgr*\nmodule, and the command line command ``mosromgr`` can be used to process either\na directory of MOS files, or a folder within an S3 bucket.\n\nThis library was developed by the `BBC News Labs`_ team.\n\n.. _BBC News Labs: https://bbcnewslabs.co.uk/\n\nUsage\n=====\n\nCommand line\n------------\n\nInspect a MOS file:\n\n.. code-block:: console\n\n    $ mosromgr inspect -f 53783448-roStoryReplace.mos.xml\n    53783448-roStoryReplace.mos.xml: StoryReplace\n    REPLACE STORY: OM_5.765650;OM_5.765654,5.765650.7 WITH:\n        STORY: OM_5.765650;OM_5.765654,5.765650.7\n\nMerge all MOS files in directory `newsnight` and save in ``FINAL.xml``:\n\n.. code-block:: console\n\n    $ mosromgr merge -f newsnight/* -o FINAL.xml\n\nLibrary\n-------\n\nLoad a ``roCreate`` file and view its stories::\n\n    from mosromgr.mostypes import RunningOrder\n\n    ro = RunningOrder.from_file('roCreate.mos.xml')\n\n    for story in ro.stories:\n        print(story.slug)\n\nMerge a single ``roStorySend`` into a ``roCreate`` and output the file to a new\nfile::\n\n    from mosromgr.mostypes import RunningOrder, StorySend\n\n    ro = RunningOrder.from_file('roCreate.mos.xml')\n    ss = StorySend.from_file('roStorySend.mos.xml')\n\n    ro += ss\n\n    with open('final.mos.xml', 'w') as f:\n        f.write(str(ro))\n\nIf you're automating this process you won't necessarily know which MOS Type to\nuse, so you can construct an object from the base class ``MosFile`` which will\nautomatically classify your file::\n\n    \u003e\u003e\u003e from mosromgr.mostypes import MosFile\n    \u003e\u003e\u003e mf1 = MosFile.from_file('roCreate.mos.xml')\n    \u003e\u003e\u003e mf1\n    \u003cRunningOrder 1000\u003e\n    \u003e\u003e\u003e mf2 = MosFile.from_file('roStorySend.mos.xml')\n    \u003e\u003e\u003e mf2\n    \u003cStorySend 1001\u003e\n\nUsing ``MosCollection`` will sort and classify multiple MOS types of all given\nfiles, allowing you to process a collection of MOS files within a complete or\npartially complete programme::\n\n    from mosromgr.moscollection import MosCollection\n\n    mos_files = ['roCreate.mos.xml', 'roStorySend.mos.xml', 'roDelete.mos.xml']\n    mc = MosCollection.from_files(mos_files)\n\n    mc.merge()\n    with open('final.mos.xml', 'w') as f:\n        f.write(str(mc))\n\nDocumentation\n=============\n\nComprehensive documentation is provided at https://mosromgr.readthedocs.io/\n\nThe documentation follows the `Diátaxis`_ system, so is split between four modes\nof documentation: tutorials, how-to guides, technical reference and explanation.\n\n.. _Diátaxis: https://diataxis.fr/\n\nIssues and questions\n====================\n\nQuestions can be asked on the `discussion board`_, and issues can be raised\non the `issue tracker`_.\n\n.. _discussion board: https://github.com/bbc/mosromgr/discussions\n.. _issue tracker: https://github.com/bbc/mosromgr/issues\n\nContributing\n============\n\nSource code can be found on GitHub at `github.com/bbc/mosromgr`_.\n\nContributions are welcome. Please refer to the `contributing guidelines`_.\n\n.. _github.com/bbc/mosromgr: https://github.com/bbc/mosromgr\n.. _contributing guidelines: https://github.com/bbc/mosromgr/blob/main/.github/CONTRIBUTING.md\n\nContributors\n============\n\n- `Ben Nuttall`_\n- `Owen Tourlamain`_\n- `Rob French`_\n- `Lucy MacGlashan`_\n- `Dave Bevan`_\n- `Matthew Sim`_\n\n.. _Ben Nuttall: https://github.com/bennuttall\n.. _Owen Tourlamain: https://github.com/OwenTourlamain\n.. _Rob French: https://github.com/FrencR\n.. _Lucy MacGlashan: https://github.com/lannem\n.. _Dave Bevan: https://github.com/bevand10\n.. _Matthew Sim: https://github.com/MattSBBC\n\nLicence\n=======\n\nLicensed under the `Apache License, Version 2.0`_.\n\n.. _Apache License, Version 2.0: https://opensource.org/licenses/Apache-2.0\n\nContact\n=======\n\nTo get in touch with the maintainers, please contact the BBC News Labs team:\nbbcnewslabsteam@bbc.co.uk\n\n.. image:: https://mosromgr.readthedocs.io/en/latest/_images/bbcnewslabs.png\n    :target: https://bbcnewslabs.co.uk/\n    :align: center\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbc%2Fmosromgr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbbc%2Fmosromgr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbbc%2Fmosromgr/lists"}