Skip to content
python module for full kodi control over HTTP Json API
Python
Branch: master
Clone or download
jcsaaddupuy Merge pull request #2 from epleterte/kodi_update_usage
rename import of XBMC class -> Kodi in README
Latest commit 24578ea Jan 23, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
kodijson fix: rename xbmc -> kodi Aug 27, 2016
tests xbmc -> kodi Aug 27, 2016
.editorconfig adds editorconfig Aug 20, 2016
.gitignore fix: update gitignore Aug 20, 2016
.travis.yml testing travisci + codecov.io with tox + coverage Aug 22, 2016
LICENSE Added licence + pypi manifest Oct 27, 2013
MANIFEST.in fix: rename xbmc -> kodi Aug 27, 2016
README.rst rename import of XBMC class -> Kodi Dec 21, 2016
example.py xbmc -> kodi Aug 27, 2016
setup.cfg xbmc -> kodi Aug 27, 2016
setup.py xbmc -> kodi Aug 27, 2016
tox.ini adds python 3.3 in tox.ini Aug 22, 2016
version.py version bump Aug 27, 2016

README.rst

Python Versions Wheel status Licence Travis codecov

python kodi json client

Simple python module that allow kodi control over HTTP Json API. Virtually support all availables commands.

Install it :

pip install kodi-json

Usages examples :

Client instanciation

from kodijson import Kodi, PLAYER_VIDEO
#Login with default kodi/kodi credentials
kodi = Kodi("http://YOURHOST/jsonrpc")

#Login with custom credentials
kodi = Kodi("http://YOURHOST/jsonrpc", "login", "password")

Ping kodi

print kodi.JSONRPC.Ping()

UI interaction :

# Navigate throught windows
kodi.GUI.ActivateWindow({"window":"home"})
kodi.GUI.ActivateWindow({"window":"weather"})

# Show some notifiations :
kodi.GUI.ShowNotification({"title":"Title", "message":"Hello notif"})

# ...and so on

Parameters can alos be passed as python parameters:

kodi.GUI.ActivateWindow(window="home")
kodi.GUI.ActivateWindow(window="weather")
kodi.GUI.ShowNotification(title="Title", message = "Hello notif")

Library interaction :

kodi.VideoLibrary.Scan()
kodi.VideoLibrary.Clean()
# ...and so on

Everything to build a script thats act as a full remote

kodi.Application.SetMute({"mute":True})
kodi.Player.PlayPause([PLAYER_VIDEO])
kodi.Player.Stop([PLAYER_VIDEO])
kodi.Input.Left()
kodi.Input.Right()
kodi.Input.Up()
kodi.Input.Down()
kodi.Input.Back()
kodi.Input.Down()
kodi.Input.Info()
# ...and so on

See http://wiki.xbmc.org/index.php?title=JSON-RPC_API/v6 for availables commands.

Every kodi namespaces are accessible from the instanciated kodi client.

Every commands presents in the API documentation should be available.

You can take a look at xbmc-client for an implementation example.

Contribute

Please make your PR on the branch develop :)

You can’t perform that action at this time.