Skip to main content

An async python interface for Kodi over JSON-RPC.

Project description

PyKodi

An async python interface for Kodi over JSON-RPC. This is mostly designed to integrate with HomeAssistant. If you have other needs, there might be better packages available.

Installation

You can install PyKodi from PyPI:

pip3 install pykodi

Python 3.7 and above are supported.

How to use

from pykodi import get_kodi_connection, Kodi
kc = get_kodi_connection(<host>, <port>, <ws_port>, <username>, <password>, <ssl>, <timeout>, <session>)
# if ws_port is None the connection will be over HTTP, otherwise over WebSocket.
# ssl defaults to False (only relevant if you have a proxy), timeout to 5 (seconds)
# session is generated if not passed in

# you can also pass in your own session
await kc.connect()

kodi = Kodi(kc)

await kodi.ping()
properties = await kodi.get_application_properties(["name", "version"])

await kodi.play()
await kodi.volume_up()
await kodi.pause()
...

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

pykodi-0.2.1.tar.gz (6.3 kB view hashes)

Uploaded Source

Built Distribution

pykodi-0.2.1-py3-none-any.whl (5.7 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