0.23 Python bindings/Data Objects

From MythTV Official Wiki
Revision as of 20:54, 1 February 2010 by Brianboonstra (talk | contribs) (Add category (Python))

Jump to: navigation, search

The basic data object supplied by the Python bindings is designed to operate as a dictionary or as a class with attributes.

>>> prog = be.getRecordings()[0]
>>> prog.keys()
['title', 'subtitle', 'description', 'category', 'chanid', 'channum', 'callsign', 'channame', 'filename', 'fs_high', 'fs_low', 'starttime', 'endtime', 'duplicate', 'shareable', 'findid', 'hostname', 'sourceid', 'cardid', 'inputid', 'recpriority', 'recstatus', 'recordid', 'rectype', 'dupin', 'dupmethod', 'recstartts', 'recendts', 'repeat', 'programflags', 'recgroup', 'commfree', 'outputfilters', 'seriesid', 'programid', 'lastmodified', 'stars', 'airdate', 'hasairdate', 'playgroup', 'recpriority2', 'parentid', 'storagegroup', 'audio_props', 'video_props', 'subtitle_type', 'year']
>>> prog.title
>>> prog['channame']
u'USA Network'
>>> a = prog.iteritems()
>>> a.next()
('title', u'Psych')

Data Only objects

These objects are read only, and populated by data from the backend.


This class is the standard Program Info structure used by the backend protocol. It provides the following fields: title, subtitle, description, category, chanid, channum, callsign, channame, filename, fs_high, fs_low, starttime, endtime, duplicate, shareable, findid, hostname, sourceid, cardid, inputid, recpriority, recstatus, recordid, rectype, dupin, dupmethod, recstartts, recendts, repeat, programflags, recgroup, commfree, outputfilters, seriesid, programid, lastmodified, stars, airdate, hasairdate, playgroup, recpriority2, parentid, storagegroup, audio_props, video_props, subtitle_type, year. Additionally, the 'filesize' attribute is is calculated from 'fs_high' and 'fs_low'.


Produces a string representation of the data, for use with backend protocol commands.

delete(force=False, rerecord=False)

Issues a protocol command to tell the backend to delete the recording. 'force' will force the delete even if the backend could not find the file. 'rerecord' informs the scheduler to allow the show to be recorded again.


Returns a matching Recorded object.


Returns a file object, defaults to read access.


Read Only Database objects

StorageGroup(id=None, db=None, raw=None)

Guide(data=None, db=None, raw=None)

Read-Write Database objects

Job(id=None, chanid=None, starttime=None, db=None, raw=None)

Channel(chanid=None, db=None, raw=None)

Video(id=None, db=None, raw=None)

Recorded(data=None, db=None, raw=None)

RecordedProgram(data=None, db=None, raw=None)

OldRecorded(data=None, db=None, raw=None)