Picasa Module

Use to parse the contacts.xml and .picasa.ini files which are geneterated by Picasa

Note

This version is tested against Picasa 3.8

class py2facer.lib.picasa.Contact(name, emails, google_hash)

An individual Google contact

Parameters:
  • name (str) – Full name of the contact
  • emails (A list or tuple of str objects or a single str) – List of e-mails associated with this contact
  • google_hash (str) – The hash value of this Contact
Variables:
  • namestr name of the contact
  • emailslist of the e-mails associated with this contact
  • google_hashstr Google hash value of the contact
class py2facer.lib.picasa.ContactParser

Used to load and parse a contacts.xml file from Picasa.

Variables:_contactsdict of Google hash values Contact objects.
has_key(key)

Allows the ContactParser to pretend it’s a dictionary

Return type:Boolean
iteritems()

Allows the ContactParser to pretend it’s a dictionary

Return type:iterator
parse_xml(in_stream)

Used to actually do the parsing of the contacts.xml file

:param File in_stream: A file-like object that can be iterated
over
class py2facer.lib.picasa.FaceParser

Class used to parse .picasa.ini files.

The .picasa.ini files contain (among other things) the facial data for all the images in the directory the .picasa.ini file is in.

Variables:_ini_files – A dict object of path –> parsed data
add_people_to_image(image, bounding_box=True)

Add people to an image based on the Picasa ini

Parameters:
  • image (lib.Image) – An lib.Image object to add facial data to
  • bounding_box – Should the bounding box for individual faces be parsed.

Previous topic

Image Module

Next topic

Utils Module

This Page