I'm developing a Librarian addon and have developed this Library Data Module to support my addon development. It allows read access to the video library using python syntax, all tables are linked up internally so you don't really need to know where data comes from.
It accesses the data via the xbmc API or alternatively via sqlite3 directly for testing so throws open the opportunity to use it for making external xbmc scripts too.
Download Latest here: xbmcdata_1.1.tar.bz2
It should work on any platform, but hasn't been tested on anything outside of Ubuntu 10.10. To use, you can simply do the following:
from xbmcdata import Movies
mymovies = Movies()
for movie in mymovies:
for actor in movie['actors']:
#print "+ Staring: %s" % unicode(actor)
for movie2 in actor['acted_movies']:
if movie != movie2:
print "++ Who was Also in: %s" % unicode(movie2)
And so on...
This is a first generation module, so I expect that if people use it more, errors will crop up. But I have written a comprehensive python test suite, so fixing problems shouldn't be too hard.
Most of the API is the same as you would expect in the database, but with some plurals for python names (classes etc) the actors many to many tables are probably the most original property names.