{"id":18455220,"url":"https://github.com/castagnait/script.module.addon.connector","last_synced_at":"2025-04-22T17:05:14.365Z","repository":{"id":69589679,"uuid":"345619059","full_name":"CastagnaIT/script.module.addon.connector","owner":"CastagnaIT","description":"A Kodi module to provide the communication between add-ons and add-ons services","archived":false,"fork":false,"pushed_at":"2021-03-26T10:36:52.000Z","size":75,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-16T14:56:10.454Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CastagnaIT.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.txt","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":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-08T10:35:48.000Z","updated_at":"2021-04-30T09:36:37.000Z","dependencies_parsed_at":"2023-02-28T04:01:15.438Z","dependency_job_id":null,"html_url":"https://github.com/CastagnaIT/script.module.addon.connector","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CastagnaIT%2Fscript.module.addon.connector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CastagnaIT%2Fscript.module.addon.connector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CastagnaIT%2Fscript.module.addon.connector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CastagnaIT%2Fscript.module.addon.connector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CastagnaIT","download_url":"https://codeload.github.com/CastagnaIT/script.module.addon.connector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250285662,"owners_count":21405296,"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":[],"created_at":"2024-11-06T08:07:27.546Z","updated_at":"2025-04-22T17:05:14.344Z","avatar_url":"https://github.com/CastagnaIT.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Addon connector for Kodi (script.module.addon.connector)\n\n[![Kodi version](https://img.shields.io/badge/kodi%20versions-19-blue)](https://kodi.tv/)\n[![GitHub release](https://img.shields.io/github/release/CastagnaIT/script.module.addon.connector.svg)](https://github.com/CastagnaIT/script.module.addon.connector/releases)\n[![CI](https://github.com/CastagnaIT/script.module.addon.connector/workflows/CI/badge.svg)](https://github.com/CastagnaIT/script.module.addon.connector/actions?query=workflow:CI)\n[![Codecov](https://img.shields.io/codecov/c/github/CastagnaIT/script.module.addon.connector/master)](https://codecov.io/gh/CastagnaIT/script.module.addon.connector/branch/master)\n[![License: LGPL-2.1 or later](https://img.shields.io/badge/license-LGPLv2.1_or_later-blue)](https://opensource.org/licenses/LGPL-2.1)\n[![Contributors](https://img.shields.io/github/contributors/CastagnaIT/script.module.addon.connector.svg)](https://github.com/CastagnaIT/script.module.addon.connector/graphs/contributors)\n\nA Kodi module to provide communication between add-ons and add-ons services.\n\n***Project temporary stopped due to a memory leak on Kodi JSON-RPC call:***\nhttps://github.com/xbmc/xbmc/issues/19332\n\n\n## Main features\n\n- Allows exchanging data between an add-on to his service or another add-on service\n- Allows exchanging data between an add-on to another add-on\n- Allows exchanging data between multiple add-on services\n- Allows call a function of another add-on or service (no return data)\n- With the default data serialization ([pickle](https://docs.python.org/3/library/pickle.html#what-can-be-pickled-and-unpickled))\nyou can transfer the most python data types\n- Supports automatic forwarding of the exceptions to the add-on that made the call\n\n## How integrate it into your add-on\n\nA quick example of add-on communication, to allow data to be sent and received between the add-on and its service.\n\nWe assume that you have already developed a Kodi add-on with [his service](https://kodi.wiki/view/Service_add-ons),\nthen in the add-on script, we make the call to his service in order to send and ask some data: \n\n```python\nimport addonconnector\nimport xbmc\n\nCALL_CFG = addonconnector.CallConfig(None)\n\ndef ask_data_to_service():\n    ret_data = addonconnector.make_call(CALL_CFG.signal_name('the_service_function'),\n                                        'sun', color='yellow')\n    xbmc.log('Response received from the service: ' + ret_data)\n```\n\nOn the service script of the add-on, we handle the callback, to answer to the add-on call request:\n\n```python\nimport addonconnector\nimport xbmc\n\ndef the_service_function(name, color='blue'):\n    xbmc.log('The add-on has asked if the {} is {}.'.format(name, color))\n    data = 'Yes it is!' if color == 'yellow' else 'Nope!'\n    # Here you can return any kind of data also the raised exceptions will be forwarded\n    return data\n\nif __name__ == '__main__':\n    monitor = xbmc.Monitor()\n    addonconnector.register_callback(the_service_function)\n    while not monitor.abortRequested():\n    # ...follow the Kodi add-on service development example\n```\n\nYou can find all the detailed instructions and others examples are on the Wiki pages.\n\n## Download links\n\nInstall add-on via repository - provide automatic installation of updates:\n\nTodo\n\n## License\n\nLicensed under GNU Lesser General Public License version 2.1.\n\n## Credits\n\nThis module is based on the \"Addon Signals\" module, thanks to Rick Phillips (Ruuk) who developed Addon Signals module:\u003cbr/\u003e\nhttps://github.com/ruuk/script.module.addon.signals\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcastagnait%2Fscript.module.addon.connector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcastagnait%2Fscript.module.addon.connector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcastagnait%2Fscript.module.addon.connector/lists"}