{"id":17645479,"url":"https://github.com/bradwood/pyskyq","last_synced_at":"2025-05-07T05:06:29.015Z","repository":{"id":68320961,"uuid":"147579992","full_name":"bradwood/pyskyq","owner":"bradwood","description":"A Python library to control a SkyQ box.","archived":false,"fork":false,"pushed_at":"2018-11-05T10:53:15.000Z","size":477,"stargazers_count":5,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T05:06:23.527Z","etag":null,"topics":["epg","python","sky","skyq","tv","xmltv"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bradwood.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-05T21:11:04.000Z","updated_at":"2022-09-28T22:18:21.000Z","dependencies_parsed_at":"2023-02-22T23:01:32.962Z","dependency_job_id":null,"html_url":"https://github.com/bradwood/pyskyq","commit_stats":null,"previous_names":[],"tags_count":39,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradwood%2Fpyskyq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradwood%2Fpyskyq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradwood%2Fpyskyq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bradwood%2Fpyskyq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bradwood","download_url":"https://codeload.github.com/bradwood/pyskyq/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252817010,"owners_count":21808705,"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":["epg","python","sky","skyq","tv","xmltv"],"created_at":"2024-10-23T10:56:30.975Z","updated_at":"2025-05-07T05:06:28.987Z","avatar_url":"https://github.com/bradwood.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n======\npyskyq\n======\n\n|Build Status| |docs| |pypi| |python| |license|\n\nA Python library for controlling a SkyQ Box.\n\nIntroduction\n============\n\nThis library aims to eventually provide API access to the `Sky Q Set Top Box`_.  It\nis only tested on Python 3.7 and uses the newer async support offered by this version\nof Python.\n\nIt uses the **excellent** trio_ async library and so knowledge of this is advised.\n\nIt is still a work in progress, but what is here, works.\n\n\n.. _Sky Q Set Top Box: https://www.sky.com/shop/tv/sky-q/\n.. _trio: https://trio.readthedocs.io/en/latest/\n\n\nInstalling\n==========\n\nTo install:\n\n.. code:: bash\n\n    pip install pyskyq\n\n\nUsage\n=====\n\nThere are currently three main capabilities provided by the library.\n\nPressing buttons on the remote\n------------------------------\n\nHere is how to emulate a button-press on the SkyQ Remote. See the documentation\nfor the class `REMOTECOMMANDS` for the various buttons that can be pressed.\n\n.. code:: python\n\n    from pyskyq import Remote, RCMD\n\n        press_remote('skyq', RCMD.play)\n\nReacting to status changes on the box\n-------------------------------------\n\nHere is how to set up an async context manager that can be used to react to\nchanged events on the box..\n\n.. code:: python\n\n    from pyskyq import get_status\n\n    async def report_box_online():\n        \"\"\"Report whether the SkyQ is online or not.\"\"\"\n        # pylint: disable=not-async-context-manager\n        async with get_status('skyq') as stat:\n            while True:\n                if stat.online:\n                    print('The SkyQ Box is Online ')\n                else:\n                    print('The SkyQ Box is Offline')\n                await trio.sleep(1)\n    try:\n        print(\"Type Ctrl-C to exit.\")\n        trio.run(report_box_online)\n    except KeyboardInterrupt:\n        raise SystemExit(0)\n\n\nLoading and interrogating channel data\n--------------------------------------\n\nGetting access to channel data requires initialising an ``EPG`` object. Once\nthis is done, you need to load the channel data from the box using the\n``EPG.load_skyq_channel_data()`` method.\n\nTo access this data use ``EPG.get_channel()``. See the method's documentation\nfor the full list of available attributes.\n\n.. code:: python\n\n    from pyskyq import EPG\n\n    async def main():\n        \"\"\"Run main routine, allowing arguments to be passed.\"\"\"\n        pargs = parse_args(args)\n        epg = EPG('skyq')  # replace with hostname / IP of your Sky box\n        await epg.load_skyq_channel_data()  # load channel listing from Box.\n        all_72_hour = XMLTVListing('http://www.xmltv.co.uk/feed/6715')\n\n        async with trio.open_nursery() as nursery:\n            nursery.start_soon(all_72_hour.fetch)\n\n        epg.apply_XMLTVListing(all_72_hour)\n\n        print('Channel Description from the SkyQ Box:')\n        print(epg.get_channel_by_sid(2002).desc)\n        print('Channel XMLTV ID from the XMLTV Feed:')\n        print(epg.get_channel_by_sid(2002).xmltv_id)\n        print('Channel Logo URL from the XMLTV Feed:')\n        print(epg.get_channel_by_sid(2002).xmltv_icon_url)\n\n    if __name__ == \"__main__\":\n        trio.run(main)\n\n\nDocumentation\n=============\n\nPlease refer to the documentation at https://bradwood.gitlab.io/pyskyq/\n\n\nContributions\n=============\n\nContributions are welcome. Please fork the project on GitLab_ **Not GitHub** and\nraise an issue and merge request there.\n\n.. _GitLab: https://gitlab.com/bradwood/pyskyq/\n\n\nCredits\n=======\nCode and ideas obtained from:\n\n- https://github.com/dalhundal/sky-remote\n- https://gladdy.uk/blog/2017/03/13/skyq-upnp-rest-and-websocket-api-interfaces/\n\nThank you to those individuals for their contributions.\n\n\n\n.. |Build Status| image:: https://gitlab.com/bradwood/pyskyq/badges/master/pipeline.svg\n   :target: https://gitlab.com/bradwood/pyskyq/pipelines\n\n.. |docs| image:: https://img.shields.io/badge/docs-passing-brightgreen.svg\n   :target: https://bradwood.gitlab.io/pyskyq/\n\n.. |pypi| image:: https://badge.fury.io/py/pyskyq.svg\n   :target: https://badge.fury.io/py/pyskyq\n\n.. |python| image:: https://img.shields.io/pypi/pyversions/pyskyq.svg\n   :target: https://pypi.org/project/pyskyq/\n\n.. |license| image:: https://img.shields.io/badge/license-MIT-blue.svg\n   :target: https://gitlab.com/bradwood/pyskyq/raw/master/LICENSE.txt\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradwood%2Fpyskyq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbradwood%2Fpyskyq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbradwood%2Fpyskyq/lists"}