{"id":14967337,"url":"https://github.com/adafruit/adafruit_circuitpython_ble_apple_media","last_synced_at":"2026-04-23T23:02:01.436Z","repository":{"id":43807593,"uuid":"231697363","full_name":"adafruit/Adafruit_CircuitPython_BLE_Apple_Media","owner":"adafruit","description":"Support for the Apple Media Service which provides media playback info and control.","archived":false,"fork":false,"pushed_at":"2025-01-16T19:28:37.000Z","size":110,"stargazers_count":11,"open_issues_count":1,"forks_count":7,"subscribers_count":19,"default_branch":"main","last_synced_at":"2025-01-28T22:37:30.755Z","etag":null,"topics":["apple","ble","circuitpython","hacktoberfest","media","media-service"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"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/adafruit.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-01-04T02:28:24.000Z","updated_at":"2025-01-16T15:11:45.000Z","dependencies_parsed_at":"2023-01-23T19:30:53.413Z","dependency_job_id":"d91e5e7d-8dfa-4562-b6e9-c4a8961889de","html_url":"https://github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Media","commit_stats":{"total_commits":70,"total_committers":11,"mean_commits":6.363636363636363,"dds":0.7428571428571429,"last_synced_commit":"f51a46ea2d451426937a283fcfe0facbc3fe1a86"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adafruit%2FAdafruit_CircuitPython_BLE_Apple_Media","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adafruit%2FAdafruit_CircuitPython_BLE_Apple_Media/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adafruit%2FAdafruit_CircuitPython_BLE_Apple_Media/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adafruit%2FAdafruit_CircuitPython_BLE_Apple_Media/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adafruit","download_url":"https://codeload.github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Media/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237163282,"owners_count":19265245,"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":["apple","ble","circuitpython","hacktoberfest","media","media-service"],"created_at":"2024-09-24T13:37:52.340Z","updated_at":"2025-10-19T16:31:23.033Z","avatar_url":"https://github.com/adafruit.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Introduction\n============\n\n.. image:: https://readthedocs.org/projects/adafruit-circuitpython-ble_apple_media/badge/?version=latest\n    :target: https://docs.circuitpython.org/projects/ble_apple_media/en/latest/\n    :alt: Documentation Status\n\n.. image:: https://raw.githubusercontent.com/adafruit/Adafruit_CircuitPython_Bundle/main/badges/adafruit_discord.svg\n    :target: https://adafru.it/discord\n    :alt: Discord\n\n.. image:: https://github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Media/workflows/Build%20CI/badge.svg\n    :target: https://github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Media/actions\n    :alt: Build Status\n\n.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json\n    :target: https://github.com/astral-sh/ruff\n    :alt: Code Style: Ruff\n\nSupport for the Apple Media Service which provides media playback info and control.\n\n\nDependencies\n=============\nThis driver depends on:\n\n* `Adafruit CircuitPython \u003chttps://github.com/adafruit/circuitpython\u003e`_\n\nPlease ensure all dependencies are available on the CircuitPython filesystem.\nThis is easily achieved by downloading\n`the Adafruit library and driver bundle \u003chttps://circuitpython.org/libraries\u003e`_.\n\nInstalling from PyPI\n=====================\n\nOn supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from\nPyPI \u003chttps://pypi.org/project/adafruit-circuitpython-ble_apple_media/\u003e`_. To install for current user:\n\n.. code-block:: shell\n\n    pip3 install adafruit-circuitpython-ble-apple-media\n\nTo install system-wide (this may be required in some cases):\n\n.. code-block:: shell\n\n    sudo pip3 install adafruit-circuitpython-ble-apple-media\n\nTo install in a virtual environment in your current project:\n\n.. code-block:: shell\n\n    mkdir project-name \u0026\u0026 cd project-name\n    python3 -m venv .venv\n    source .venv/bin/activate\n    pip3 install adafruit-circuitpython-ble-apple-media\n\nUsage Example\n=============\n\n.. code-block:: python\n\n    import adafruit_ble\n    from adafruit_ble.advertising.standard import SolicitServicesAdvertisement\n    from adafruit_ble_apple_media import AppleMediaService\n\n    radio = adafruit_ble.BLERadio()\n    a = SolicitServicesAdvertisement()\n    a.solicited_services.append(AppleMediaService)\n    radio.start_advertising(a)\n\n    while not radio.connected:\n        pass\n\n    print(\"connected\")\n\n    known_notifications = set()\n\n    i = 0\n    while radio.connected:\n        for connection in radio.connections:\n            if not connection.paired:\n                connection.pair()\n                print(\"paired\")\n\n            ams = connection[AppleMediaService]\n            print(\"App:\", ams.player_name)\n            print(\"Title:\", ams.title)\n            print(\"Album:\", ams.album)\n            print(\"Artist:\", ams.artist)\n            if ams.playing:\n                print(\"Playing\")\n            elif ams.paused:\n                print(\"Paused\")\n\n            if i \u003e 3:\n                ams.toggle_play_pause()\n                i = 0\n        print()\n        time.sleep(3)\n        i += 1\n\n    print(\"disconnected\")\n\n\nDocumentation\n=============\n\nAPI documentation for this library can be found on `Read the Docs \u003chttps://docs.circuitpython.org/projects/ble_apple_media/en/latest/\u003e`_.\n\nFor information on building library documentation, please check out `this guide \u003chttps://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1\u003e`_.\n\nContributing\n============\n\nContributions are welcome! Please read our `Code of Conduct\n\u003chttps://github.com/adafruit/Adafruit_CircuitPython_BLE_Apple_Media/blob/main/CODE_OF_CONDUCT.md\u003e`_\nbefore contributing to help this project stay welcoming.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadafruit%2Fadafruit_circuitpython_ble_apple_media","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadafruit%2Fadafruit_circuitpython_ble_apple_media","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadafruit%2Fadafruit_circuitpython_ble_apple_media/lists"}