Skip to main content

Python client for Kodi server

Project description

Python client for Kodi Server API

License: MIT PyPI - Python Version

Author Denis Machard d.machard@gmail.com
License MIT
PyPI https://pypi.org/project/kodi-remotecontrol/

This is a Python remote control for Kodi Server through the JSON-RPC HTTP or the Event Server API with minimal but sufficient basic controls.

Table of contents

Installation

pip install kodi_remotecontrol

Remote control

HTTP client

As prerequisite, go to System/Settings/Network/Services and activate Allow control of Kodi via HTTP.

from kodi_remotecontrol import HttpClient

# prepare remote control
kodi_ip = "10.0.0.200"
api_rc = HttpClient(api_host=kodi_ip)

Event client

As prerequisite, go to 'System/Settings/Network/Services' and activate Allow programs on other systems to control Kodi.

from kodi_remotecontrol import EventClient

# prepare remote control
kodi_ip = "10.0.0.200"
api_rc = EventClient(api_host=kodi_ip)

UI navigation

from kodi_remotecontrol import Navigation

# prepare remote control
kodi_ip = "10.0.0.200"
api_rc = EventClient(api_host=kodi_ip)

# ui navigation
nav = Navigation(api_rc=api_rc)
nav.press_enter()
Buttons Description
press_up() UP button
press_down() DOWN button
press_left() LEFT button
press_right() RIGHT button
press_back() BACK button
press_enter() ENTER button
press_contextmenu() CONTEXT MENU button

Player interaction

from kodi_remotecontrol import Player

# prepare remote control
kodi_ip = "10.0.0.200"
api_rc = EventClient(api_host=kodi_ip)

# player interaction
nav = Player(api_rc=api_rc)
nav.press_play()
Buttons Description
press_play() PLAY button
press_stop() STOP button
press_pause() PAUSE button
press_shuffle() SHUFFLE button
press_previous() PREVIOUS button
press_next() NEXT button
press_info() INFO button

Subtitle selection

from kodi_remotecontrol import Subtitle

# prepare remote control
kodi_ip = "10.0.0.200"
api_rc = EventClient(api_host=kodi_ip)

# subtitle selection
sub = Subtitle(api_rc=api_rc)
sub.press_show()
Buttons Description
press_show() SHOW button
select_next() NEXT button

Audio track selection

from kodi_remotecontrol import Audio

# prepare remote control
kodi_ip = "10.0.0.200"
api_rc = EventClient(api_host=kodi_ip)

# audio track selection
aud = Audio(api_rc=api_rc)
aud.select_next()
Buttons Description
select_next() NEXT button

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kodi_remotecontrol-0.2.0.tar.gz (4.7 kB view hashes)

Uploaded Source

Built Distribution

kodi_remotecontrol-0.2.0-py3-none-any.whl (9.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page