[Pythonmac-SIG] iphoto, slow

Gábor Farkas gabor at nekomancer.net
Fri Dec 2 00:02:53 CET 2005


i am trying to print out all my photo's names, together with their keywords.

import appscript

app = appscript.app('iphoto')

def parsePhoto(photo):
     tags = [keyword.name() for keyword in photo.keywords()]
     return (photo.name(),tags)

for photo in app.photos():
     print parsePhoto(photo)

this code works, but it's TERRIBLY slow :)

the problem is the parsePhoto function...
those keyword.name(), photo.name(), photo.keywords() calls take nearly a 
second to complete... when printing out info about 3000photos, this will 
take some time :)

is there a better way to do this?
perharps get the data about multiple photos at the same time?
i just cannot believe iPhoto itself is so slow to provide the required 


More information about the Pythonmac-SIG mailing list