Pygmalion - Python Interface to Ma.gnolia

This is very cool...

>>> import pygmalion
>>> dir(pygmalion)
['Exceptions', 'Handlers', 'Pygmalion', 'Types', '__builtins__', '__doc__', '__file__', '__name__', '__path__']
>>> pyg = pygmalion.Pygmalion('your API key here')
>>> dir(pyg)
['__class__', '__delattr__', '__dict__', '__doc__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__', '__weakref__', 'apikey', 'bookmarks_add', 'bookmarks_delete', 'bookmarks_find', 'bookmarks_get', 'bookmarks_tags_add', 'bookmarks_tags_delete', 'bookmarks_tags_replace', 'bookmarks_update', 'headers', 'tags_find']
>>> bookmarks = pyg.bookmarks_find(person='robhudson')
>>> b = bookmarks[0]
>>> b
<Bookmark: Pygmalion (http://code.google.com/p/pygmalion/)>
>>> dir(b)
['Tags', '__class__', '__delattr__', '__dict__', '__doc__', '__getattribute__', '__hash__', '__init__', '__module__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__', '__weakref__', 'created', 'description', 'id', 'owner', 'private', 'rating', 'screenshot_url', 'tags', 'title', 'updated', 'url']
>>> b.title
'Pygmalion'
>>> b.description
'Wrapper Library for the Ma.gnolia.com Web API written in Python.  Very glad to have found this.'
>>> b.url
'http://code.google.com/p/pygmalion/'
>>> b.rating
'4'
>>> b.tags
[]
>>> # Hmmm... doesn't appear that tags are working yet...

Still, very nice. I've been hoping to add a "Blogmarks" section to my site and this will come in very handy.

About this entry

Date Posted:
October 18th 2006 at 11:10:00 PM

Tagged:
python

Previous Entry:
Javascript becoming more Pythonic?

Next Entry:
MacPorts and removing fink