photo/openphoto-python — pull request #13 by sneakypete81 (2012-08-28 20:55:13+00:00)
Title: Issue #12 - Make the library more Pythonic 

Here's an implementation of a more Pythonic interface to the OpenPhoto API. There's quite a bit to this, so feel free to cherry-pick whatever is useful, or suggest improvements, (or a totally different approach!).

To make it more extensible, I've split \_\_init\_\_.py into:
* A bare __\_\_init\_\_,py__ that just pulls in stuff from:
* __openphoto_http.py__ : low-level HTTP routines, and parameter/response processing
* __api_photo.py__ : methods for photo API endpoints (photos_list(), photo_update(), etc)
* __api_tags.py__ : same for tags
* ...
* __objects.py__ : classes enapsulating individual objects (Photos, Tags, etc)

I haven't implemented everything in the API, but I've made a start on the most common functions (listing and updating photos, tags, albums). I've been using this successfully over the past few days - the OpenPhoto API is very usable and logical.

The old-style .get and .post functions are still there, and operate in a similar manner as before, apart from a few tweaks to make them easier to work with:
* Parameters are passed in as keywords rather than a single dictionary
* Lists and boolean parameters are handled correctly
* The HTTP response is (optionally) parsed to a dict
* Error response codes (optionally) raise exceptions

The main.py commandline function is functionally unchanged.