skillfed

pykodi

An async python interface for Kodi over JSON-RPC.

pykodi v0.2.7 73.7K downloads/30d#14,938 on PyPI7
Permissive license MIT Active released

What it is and what it does

PyKodi is an async Python client library for controlling Kodi media centers remotely via JSON-RPC. It abstracts the JSON-RPC protocol into a Python API, allowing you to send commands (play, pause, volume control) and query properties (application name, version) from your own Python code. The library supports both HTTP and WebSocket transports and is built on aiohttp, jsonrpc-async, and jsonrpc-websocket for non-blocking I/O.

The package was designed primarily for integration with HomeAssistant but can be used standalone to automate or monitor Kodi instances. It requires Python 3.7 or above and handles connection setup, session management, and async communication internally. The API is straightforward: create a connection, connect asynchronously, wrap it in a Kodi object, and call methods like ping(), play(), pause(), or get_application_properties().

Use it for:

  • Integrate Kodi playback control into a HomeAssistant automation or dashboard.
  • Build a custom remote control application that sends play/pause/volume commands to Kodi over the network.
  • Query Kodi application properties or media state from a monitoring or logging script.
  • Automate media playback sequences across multiple Kodi instances in a home network.
  • Develop a lightweight CLI tool to control Kodi without a web browser or official remote.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

PyKodi provides an async Python interface to control Kodi media centers remotely over JSON-RPC, supporting both HTTP and WebSocket connections.

Yes, if you need to control Kodi from Python and are willing to accept that the package has not been updated since October 2021. Install friction is low and the MIT license is unencumbered. Verify compatibility with your Kodi version and HomeAssistant version (if applicable) before relying on it in production.

Install

pykodi on PyPI

pip

pip install pykodi

uv

uv add pykodi

poetry

poetry add pykodi

Installing pykodi

Before you install

Low install friction with pure-Python dependencies. Maintenance is active with recent commits, though the latest release is from October 2021.

License in practice

MIT license is permissive and imposes no significant restrictions on use, modification, or distribution.

Quickstart

pip install pykodi

from pykodi import get_kodi_connection, Kodi

kc = get_kodi_connection(host, port, ws_port, ssl, timeout, session, user, password)
await kc.connect()
kodi = Kodi(kc)
await kodi.ping()

Requires Python 3.7 or above; async/await syntax requires an event loop context.

Verify before relying

  • Whether the package remains compatible with modern Kodi versions beyond its last release in October 2021.
  • Whether HomeAssistant integration (its primary design target) continues to work with current versions.
  • Active maintenance status despite recent commits—whether the repository is accepting contributions or in maintenance-only mode.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.7.0)
Install friction low — pure-Python wheel
Runtime dependencies 3 — jsonrpc-async, jsonrpc-websocket, aiohttp
Maintenance actively maintained — 1,756 days since the last release
Last repo commit
First released
Downloads 73,731/month — #14,938 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: pykodi-0.2.7-py3-none-any.whl

License :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.7Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPy

Tags

kodi remote control pythonasync kodi json-rpc clientkodi home automation integrationkodi media center apipython kodi websocketkodi http rpc interface
media-center-controlhome-automation

More Internet packages