gdata.media | index /usr/local/svn/gdata-python-client/src/gdata/media/__init__.py

`Essential attributes of photos in Google Photos/Picasa Web Albums are
expressed using elements from the `media' namespace, defined in the
MediaRSS specification[1].
Due to copyright issues, the elements herein are documented sparingly, please
consult with the Google Photos API Reference Guide[2], alternatively the
official MediaRSS specification[1] for details.
(If there is a version conflict between the two sources, stick to the
Google Photos API).
[1]: http://search.yahoo.com/mrss (version 1.1.1)
[2]: http://code.google.com/apis/picasaweb/reference.html#media_reference
Keep in mind that Google Photos only uses a subset of the MediaRSS elements
(and some of the attributes are trimmed down, too):
media:content
media:credit
media:description
media:group
media:keywords
media:thumbnail
media:title`

Package Contents
`` |  |
data |  |  |

Classes
`` |  | atom.AtomBase(atom.ExtensionContainer) Duration MediaBaseElement Category Content Credit Description Group Keywords Player Thumbnail Title Private
class Category(MediaBaseElement)
`` | `The mediagroup:category element`
| Method resolution order: Category MediaBaseElement atom.AtomBase atom.ExtensionContainer __builtin__.object Methods defined here: __init__(self, term=None, scheme=None, label=None, text=None, extension_elements=None, extension_attributes=None) `Constructor for Category Args: term: str scheme: str label: str text: str The text data in the this element extension_elements: list A list of ExtensionElement instances extension_attributes: dict A dictionary of attribute value string pairs` Methods inherited from atom.AtomBase: ToString(self, string_encoding='UTF-8') `Converts the Atom object to a string containing XML.` __str__(self) Methods inherited from atom.ExtensionContainer: FindExtensions(self, tag=None, namespace=None) `Searches extension elements for child nodes with the desired name. Returns a list of extension elements within this object whose tag and/or namespace match those passed in. To find all extensions in a particular namespace, specify the namespace but not the tag name. If you specify only the tag, the result list may contain extension elements in multiple namespaces. Args: tag: str (optional) The desired tag namespace: str (optional) The desired namespace Returns: A list of elements whose tag and/or namespace match the parameters values` Data descriptors inherited from atom.ExtensionContainer: __dict__ `dictionary for instance variables (if defined)` __weakref__ `list of weak references to the object (if defined)`
class Content(MediaBaseElement)
`` | `(attribute container) This element describes the original content, e.g. an image or a video. There may be multiple Content elements in a media:Group. For example, a video may have a <media:content medium="image"> element that specifies a JPEG representation of the video, and a <media:content medium="video"> element that specifies the URL of the video itself. Attributes: url: non-ambigous reference to online object width: width of the object frame, in pixels height: width of the object frame, in pixels medium: one of `image' or `video', allowing the api user to quickly determine the object's type type: Internet media Type[1] (a.k.a. mime type) of the object -- a more verbose way of determining the media type. To set the type member in the contructor, use the content_type parameter. (optional) fileSize: the size of the object, in bytes [1]: http://en.wikipedia.org/wiki/Internet_media_type`
| Method resolution order: Content MediaBaseElement atom.AtomBase atom.ExtensionContainer __builtin__.object Methods defined here: __init__(self, url=None, width=None, height=None, medium=None, content_type=None, fileSize=None, format=None, extension_elements=None, extension_attributes=None, text=None) Methods inherited from atom.AtomBase: ToString(self, string_encoding='UTF-8') `Converts the Atom object to a string containing XML.` __str__(self) Methods inherited from atom.ExtensionContainer: FindExtensions(self, tag=None, namespace=None) `Searches extension elements for child nodes with the desired name. Returns a list of extension elements within this object whose tag and/or namespace match those passed in. To find all extensions in a particular namespace, specify the namespace but not the tag name. If you specify only the tag, the result list may contain extension elements in multiple namespaces. Args: tag: str (optional) The desired tag namespace: str (optional) The desired namespace Returns: A list of elements whose tag and/or namespace match the parameters values` Data descriptors inherited from atom.ExtensionContainer: __dict__ `dictionary for instance variables (if defined)` __weakref__ `list of weak references to the object (if defined)`
class Credit(MediaBaseElement)
`` | `(string) Contains the nickname of the user who created the content, e.g. `Liz Bennet'. This is a user-specified value that should be used when referring to the user by name. Note that none of the attributes from the MediaRSS spec are supported.`
| Method resolution order: Credit MediaBaseElement atom.AtomBase atom.ExtensionContainer __builtin__.object Methods inherited from MediaBaseElement: __init__(self, name=None, extension_elements=None, extension_attributes=None, text=None) Methods inherited from atom.AtomBase: ToString(self, string_encoding='UTF-8') `Converts the Atom object to a string containing XML.` __str__(self) Methods inherited from atom.ExtensionContainer: FindExtensions(self, tag=None, namespace=None) `Searches extension elements for child nodes with the desired name. Returns a list of extension elements within this object whose tag and/or namespace match those passed in. To find all extensions in a particular namespace, specify the namespace but not the tag name. If you specify only the tag, the result list may contain extension elements in multiple namespaces. Args: tag: str (optional) The desired tag namespace: str (optional) The desired namespace Returns: A list of elements whose tag and/or namespace match the parameters values` Data descriptors inherited from atom.ExtensionContainer: __dict__ `dictionary for instance variables (if defined)` __weakref__ `list of weak references to the object (if defined)`
class Description(MediaBaseElement)
`` | `(string) A description of the media object. Either plain unicode text, or entity-encoded html (look at the `type' attribute). E.g `A set of photographs I took while vacationing in Italy.' For `api' projections, the description is in plain text; for `base' projections, the description is in HTML. Attributes: type: either `text' or `html'. To set the type member in the contructor, use the description_type parameter.`
| Method resolution order: Description MediaBaseElement atom.AtomBase atom.ExtensionContainer __builtin__.object Methods defined here: __init__(self, description_type=None, extension_elements=None, extension_attributes=None, text=None) Methods inherited from atom.AtomBase: ToString(self, string_encoding='UTF-8') `Converts the Atom object to a string containing XML.` __str__(self) Methods inherited from atom.ExtensionContainer: FindExtensions(self, tag=None, namespace=None) `Searches extension elements for child nodes with the desired name. Returns a list of extension elements within this object whose tag and/or namespace match those passed in. To find all extensions in a particular namespace, specify the namespace but not the tag name. If you specify only the tag, the result list may contain extension elements in multiple namespaces. Args: tag: str (optional) The desired tag namespace: str (optional) The desired namespace Returns: A list of elements whose tag and/or namespace match the parameters values` Data descriptors inherited from atom.ExtensionContainer: __dict__ `dictionary for instance variables (if defined)` __weakref__ `list of weak references to the object (if defined)`
class Duration(atom.AtomBase)
`` | `The YouTube Duration element`
| Method resolution order: Duration atom.AtomBase atom.ExtensionContainer __builtin__.object Methods inherited from atom.AtomBase: ToString(self, string_encoding='UTF-8') `Converts the Atom object to a string containing XML.` __init__(*args, **kwargs) `# The deprecated_function wraps the actual call to f.` __str__(self) Methods inherited from atom.ExtensionContainer: FindExtensions(self, tag=None, namespace=None) `Searches extension elements for child nodes with the desired name. Returns a list of extension elements within this object whose tag and/or namespace match those passed in. To find all extensions in a particular namespace, specify the namespace but not the tag name. If you specify only the tag, the result list may contain extension elements in multiple namespaces. Args: tag: str (optional) The desired tag namespace: str (optional) The desired namespace Returns: A list of elements whose tag and/or namespace match the parameters values` Data descriptors inherited from atom.ExtensionContainer: __dict__ `dictionary for instance variables (if defined)` __weakref__ `list of weak references to the object (if defined)`
class Group(MediaBaseElement)
`` | `Container element for all media elements. The <media:group> element can appear as a child of an album, photo or video entry.`
| Method resolution order: Group MediaBaseElement atom.AtomBase atom.ExtensionContainer __builtin__.object Methods defined here: __init__(self, content=None, credit=None, description=None, keywords=None, thumbnail=None, title=None, duration=None, private=None, category=None, player=None, extension_elements=None, extension_attributes=None, text=None) Methods inherited from atom.AtomBase: ToString(self, string_encoding='UTF-8') `Converts the Atom object to a string containing XML.` __str__(self) Methods inherited from atom.ExtensionContainer: FindExtensions(self, tag=None, namespace=None) `Searches extension elements for child nodes with the desired name. Returns a list of extension elements within this object whose tag and/or namespace match those passed in. To find all extensions in a particular namespace, specify the namespace but not the tag name. If you specify only the tag, the result list may contain extension elements in multiple namespaces. Args: tag: str (optional) The desired tag namespace: str (optional) The desired namespace Returns: A list of elements whose tag and/or namespace match the parameters values` Data descriptors inherited from atom.ExtensionContainer: __dict__ `dictionary for instance variables (if defined)` __weakref__ `list of weak references to the object (if defined)`
class Keywords(MediaBaseElement)
`` | `(string) Lists the tags associated with the entry, e.g `italy, vacation, sunset'. Contains a comma-separated list of tags that have been added to the photo, or all tags that have been added to photos in the album.`
| Method resolution order: Keywords MediaBaseElement atom.AtomBase atom.ExtensionContainer __builtin__.object Methods inherited from MediaBaseElement: __init__(self, name=None, extension_elements=None, extension_attributes=None, text=None) Methods inherited from atom.AtomBase: ToString(self, string_encoding='UTF-8') `Converts the Atom object to a string containing XML.` __str__(self) Methods inherited from atom.ExtensionContainer: FindExtensions(self, tag=None, namespace=None) `Searches extension elements for child nodes with the desired name. Returns a list of extension elements within this object whose tag and/or namespace match those passed in. To find all extensions in a particular namespace, specify the namespace but not the tag name. If you specify only the tag, the result list may contain extension elements in multiple namespaces. Args: tag: str (optional) The desired tag namespace: str (optional) The desired namespace Returns: A list of elements whose tag and/or namespace match the parameters values` Data descriptors inherited from atom.ExtensionContainer: __dict__ `dictionary for instance variables (if defined)` __weakref__ `list of weak references to the object (if defined)`
class MediaBaseElement(atom.AtomBase)
`` | `Base class for elements in the MEDIA_NAMESPACE. To add new elements, you only need to add the element tag name to self._tag`
| Method resolution order: MediaBaseElement atom.AtomBase atom.ExtensionContainer __builtin__.object Methods defined here: __init__(self, name=None, extension_elements=None, extension_attributes=None, text=None) Methods inherited from atom.AtomBase: ToString(self, string_encoding='UTF-8') `Converts the Atom object to a string containing XML.` __str__(self) Methods inherited from atom.ExtensionContainer: FindExtensions(self, tag=None, namespace=None) `Searches extension elements for child nodes with the desired name. Returns a list of extension elements within this object whose tag and/or namespace match those passed in. To find all extensions in a particular namespace, specify the namespace but not the tag name. If you specify only the tag, the result list may contain extension elements in multiple namespaces. Args: tag: str (optional) The desired tag namespace: str (optional) The desired namespace Returns: A list of elements whose tag and/or namespace match the parameters values` Data descriptors inherited from atom.ExtensionContainer: __dict__ `dictionary for instance variables (if defined)` __weakref__ `list of weak references to the object (if defined)`
class Player(MediaBaseElement)
`` | `(string) Contains the embeddable player URL for the entry's media content if the media is a video. Attributes: url: Always set to plain`
| Method resolution order: Player MediaBaseElement atom.AtomBase atom.ExtensionContainer __builtin__.object Methods defined here: __init__(self, player_url=None, extension_attributes=None, extension_elements=None) Methods inherited from atom.AtomBase: ToString(self, string_encoding='UTF-8') `Converts the Atom object to a string containing XML.` __str__(self) Methods inherited from atom.ExtensionContainer: FindExtensions(self, tag=None, namespace=None) `Searches extension elements for child nodes with the desired name. Returns a list of extension elements within this object whose tag and/or namespace match those passed in. To find all extensions in a particular namespace, specify the namespace but not the tag name. If you specify only the tag, the result list may contain extension elements in multiple namespaces. Args: tag: str (optional) The desired tag namespace: str (optional) The desired namespace Returns: A list of elements whose tag and/or namespace match the parameters values` Data descriptors inherited from atom.ExtensionContainer: __dict__ `dictionary for instance variables (if defined)` __weakref__ `list of weak references to the object (if defined)`
class Private(atom.AtomBase)
`` | `The YouTube Private element`
| Method resolution order: Private atom.AtomBase atom.ExtensionContainer __builtin__.object Methods inherited from atom.AtomBase: ToString(self, string_encoding='UTF-8') `Converts the Atom object to a string containing XML.` __init__(*args, **kwargs) `# The deprecated_function wraps the actual call to f.` __str__(self) Methods inherited from atom.ExtensionContainer: FindExtensions(self, tag=None, namespace=None) `Searches extension elements for child nodes with the desired name. Returns a list of extension elements within this object whose tag and/or namespace match those passed in. To find all extensions in a particular namespace, specify the namespace but not the tag name. If you specify only the tag, the result list may contain extension elements in multiple namespaces. Args: tag: str (optional) The desired tag namespace: str (optional) The desired namespace Returns: A list of elements whose tag and/or namespace match the parameters values` Data descriptors inherited from atom.ExtensionContainer: __dict__ `dictionary for instance variables (if defined)` __weakref__ `list of weak references to the object (if defined)`
class Thumbnail(MediaBaseElement)
`` | `(attributes) Contains the URL of a thumbnail of a photo or album cover. There can be multiple <media:thumbnail> elements for a given <media:group>; for example, a given item may have multiple thumbnails at different sizes. Photos generally have two thumbnails at different sizes; albums generally have one cropped thumbnail. If the thumbsize parameter is set to the initial query, this element points to thumbnails of the requested sizes; otherwise the thumbnails are the default thumbnail size. This element must not be confused with the <gphoto:thumbnail> element. Attributes: url: The URL of the thumbnail image. height: The height of the thumbnail image, in pixels. width: The width of the thumbnail image, in pixels.`
| Method resolution order: Thumbnail MediaBaseElement atom.AtomBase atom.ExtensionContainer __builtin__.object Methods defined here: __init__(self, url=None, width=None, height=None, extension_attributes=None, text=None, extension_elements=None) Methods inherited from atom.AtomBase: ToString(self, string_encoding='UTF-8') `Converts the Atom object to a string containing XML.` __str__(self) Methods inherited from atom.ExtensionContainer: FindExtensions(self, tag=None, namespace=None) `Searches extension elements for child nodes with the desired name. Returns a list of extension elements within this object whose tag and/or namespace match those passed in. To find all extensions in a particular namespace, specify the namespace but not the tag name. If you specify only the tag, the result list may contain extension elements in multiple namespaces. Args: tag: str (optional) The desired tag namespace: str (optional) The desired namespace Returns: A list of elements whose tag and/or namespace match the parameters values` Data descriptors inherited from atom.ExtensionContainer: __dict__ `dictionary for instance variables (if defined)` __weakref__ `list of weak references to the object (if defined)`
class Title(MediaBaseElement)
`` | `(string) Contains the title of the entry's media content, in plain text. Attributes: type: Always set to plain. To set the type member in the constructor, use the title_type parameter.`
| Method resolution order: Title MediaBaseElement atom.AtomBase atom.ExtensionContainer __builtin__.object Methods defined here: __init__(self, title_type=None, extension_attributes=None, text=None, extension_elements=None) Methods inherited from atom.AtomBase: ToString(self, string_encoding='UTF-8') `Converts the Atom object to a string containing XML.` __str__(self) Methods inherited from atom.ExtensionContainer: FindExtensions(self, tag=None, namespace=None) `Searches extension elements for child nodes with the desired name. Returns a list of extension elements within this object whose tag and/or namespace match those passed in. To find all extensions in a particular namespace, specify the namespace but not the tag name. If you specify only the tag, the result list may contain extension elements in multiple namespaces. Args: tag: str (optional) The desired tag namespace: str (optional) The desired namespace Returns: A list of elements whose tag and/or namespace match the parameters values` Data descriptors inherited from atom.ExtensionContainer: __dict__ `dictionary for instance variables (if defined)` __weakref__ `list of weak references to the object (if defined)`

Functions
`` |  | ContentFromString(xml_string) CreditFromString(xml_string) DescriptionFromString(xml_string) GroupFromString(xml_string) KeywordsFromString(xml_string) ThumbnailFromString(xml_string) TitleFromString(xml_string)

Data
`` |  | MEDIA_NAMESPACE = 'http://search.yahoo.com/mrss/' YOUTUBE_NAMESPACE = 'http://gdata.youtube.com/schemas/2007' __author__ = u'havard@gulldahl.no' __license__ = 'Apache License v2'

Author
`` |  | havard@gulldahl.no