chirayu
Dec-06-2007, 01:49 AM
Hi,
I am pleased to share Python functional API's for Smugmug. API's are hosted at http://code.google.com/p/smugmug-api/.
The python API's use REST and provide a functional interface to the Smugmug API. They are agnostic to the contents of the response and in that sense the API's are future proof (of course the software using the API's will be affected by changes).
Examples
Each method in the Smugmug API is translated into a function by removing the preceding smugmug, and replacing the "." with "_". So, smugmug.users.getTree becomes users_getTree.
The parameters of the functions take the same name as the arguments of the method. The following is a call to retrieve album statistics - API.albums_getStats (SessionID=session_id, AlbumID=album["id"], Month="1", Year="2007")
Examples to showcase the API are located in the examples/ directory in the smug_func_ops.py file. Examples include - display random image, download an album, get the most popular image. To get a random image, you can use "python smug_func_ops.py -m random_image -e <your email> -p <your password>"
What is missing?
Search
Upload (update: added)
Caching framework to deal with downloaded imagesUPDATE:
Original post is modified to reflect modified file names and to clarify out that these are functional API's
Have fun,
Chirayu
I am pleased to share Python functional API's for Smugmug. API's are hosted at http://code.google.com/p/smugmug-api/.
The python API's use REST and provide a functional interface to the Smugmug API. They are agnostic to the contents of the response and in that sense the API's are future proof (of course the software using the API's will be affected by changes).
Examples
Each method in the Smugmug API is translated into a function by removing the preceding smugmug, and replacing the "." with "_". So, smugmug.users.getTree becomes users_getTree.
The parameters of the functions take the same name as the arguments of the method. The following is a call to retrieve album statistics - API.albums_getStats (SessionID=session_id, AlbumID=album["id"], Month="1", Year="2007")
Examples to showcase the API are located in the examples/ directory in the smug_func_ops.py file. Examples include - display random image, download an album, get the most popular image. To get a random image, you can use "python smug_func_ops.py -m random_image -e <your email> -p <your password>"
What is missing?
Search
Upload (update: added)
Caching framework to deal with downloaded imagesUPDATE:
Original post is modified to reflect modified file names and to clarify out that these are functional API's
Have fun,
Chirayu