Zootool.com API Wrapper - Pyzootool

I recently came across a site named Zootool, which as far as I can gather is basically like Delicious. My usage of such sites always works out to be basically the same. I think “Oh wow, this will be really useful for when I find sites I like, can’t read right now, but will want to tag to read later on a different PC”. The problem is that it never actually works out that way. I tag things, and never remember tagging them, and never end up actually reading whatever I tag. It boils down to a week of “Wow this is super cool!”, and then I never visit again. It’s not the site’s fault, I’m just inept.

That mini-rant aside, I noticed that the creators of Zootool were kind enough to build a small, but very useful, API on to their site. At the time I realized the only wrapper that had been written for this API was in PHP. Not wanting to see Python under represented, I decided to embark on wrapping their API up in Python. I’m pleased to say that thus far it’s turned out fairly well. I have the entire API wrapped in Python now, and everything seems to work fairly well.

Their API is REST-like, so I used httplib2 to do most of my wrappings. The library allows you to do all of the following:

  • Retrieve user data
  • Retrieve items by their uid
  • Retrieve items by popularity in the last week, day, month, or year
  • Retrieve personal items (if authenticated)
  • Retrieve a user’s friends
  • Retrieve a user’s followers
  • Add items to your zoo (if authenticated)
It’s been pretty painless to do all the wrappings, but there’s still some cleanup left to do in the code. I’d like to add some test cases, just to cover myself if nothing else. Also, there’s a few areas where you could potentially end up with some nasty exceptions on edge cases. Still, I’m pretty happy with what’s been accomplished thus far in a short amount of time.

When I was writing it, I was really trying to model how it functions after tweepy, because I’ve always enjoyed how it functions. Thanks to the maker(s) of tweepy for the inspiration. Hopefully someone finds some uses for pyzootool though, never know when you might need to do some social media data mining against it :) All the code for it can be found at my github repo, and if you just want to install it you should be able to just do “pip install pyzootool”, and enjoy.

If anyone has any feedback, criticisms, or suggestions, please let me know!