Kodi Community Forum

Full Version: [RELEASE] XBMC Library Data Module
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello XBMC Community,

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:

Code:
from xbmcdata import Movies

mymovies = Movies()
for movie in mymovies:
  #print unicode(movie)
  #print unicode(movie['idFile'])
  if movie['actors']:
    for actor in movie['actors']:
      #print "+ Staring: %s" % unicode(actor)
      if actor['acted_movies']:
        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 comprehensiveNerd 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.
I've released a new version. 1.1. This version actually works inside xbmc and most of the issues are repaired. We also have better handling of tv show guides and lots of other interesting data structures.

Download here: xbmcdata_1.1.tar.bz2