|
[Flickr APIs] Python FlickrClient, version two: msg#00085web.flickr.api
Hi, thanks to Nelson Minar for pointing me to xmltramp[1] now I have a much better version of the client, with the bonus of exception based error checking. Here is a basic usage example: client = FlickrClient(API_KEY) person = client.flickr_people_getInfo(user_id=USER_ID) photoSets = client.flickr_photosets_getList(user_id=USER_ID) print person.username, "has", len(photoSets), "photosets:", print ', '.join([str(set.title) for set in photoSets]) you access sub-element just as if they were attributes of your node, attribute access is done as a function call on the node: person('id'), to retrieve the text element of a node, convert it to string: str(person.username). In case of errors it will raise a FlickrError exception with two attributes: code and message. mic [1]: http://www.aaronsw.com/2002/xmltramp/ [2]: an article with a more in-depth explanation of xmltramp http://www.xml.com/pub/a/2003/12/17/py-xml.html -- Michele Campeotto - www.micampe.it You know there ain't no devil, there's just god when he's drunk
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | [Flickr APIs] flickr.favorites.getList suggestion: 00085, Fabricio Zuardi |
|---|---|
| Next by Date: | [Flickr APIs] ★お元気ですか?: 00085, boracay777jp-/E1597aS9LR3+QwDJ9on6Q |
| Previous by Thread: | Re: [Flickr APIs] Python FlickrClienti: 00085, Eric Costello |
| Next by Thread: | [Flickr APIs] Re: Python FlickrClient, version two: 00085, Michele Campeotto |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |