Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Python library for SmugMug API that supports Oauth and Google App Engine
Python
Branch: master
Pull request Compare This branch is 43 commits behind chrishoffman:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
examples
src
CHANGELOG.md
LICENSE
README.md
setup.py

README.md

Smugpy

Smugpy is an Python library for the SmugMug API created by Chris Hoffman. Smugpy supports all versions of the API and Oauth 1.0 for API versions 1.2.2+. This library also works in Google App Engine. For more information on the SmugMug API, see SmugMug API Documentation.

Installation

Installing the python client is a very simple process. Once you've downloaded the source bundle for the client, execute the following:

python setup.py install

Usage

Anonymous request:

from smugpy import SmugMug

API_KEY = "XXXXXXXXXXXXXXXXXXXXXXXXX"

smugmug = SmugMug(api_key=API_KEY, app_name="TestApp")
smugmug.login_anonymously()
albums = smugmug.albums_get(NickName="williams")

for album in albums["Albums"]:
    print "%s, %s" % (album["id"], album["Title"])

Anonymous request (1.3.0+):

from smugpy import SmugMug

API_KEY = "XXXXXXXXXXXXXXXXXXXXXXXXX"

smugmug = SmugMug(api_key=API_KEY, api_version="1.3.0", app_name="TestApp")
albums = smugmug.albums_get(NickName="williams")

for album in albums["Albums"]:
    print "%s, %s" % (album["id"], album["Title"])

Oauth request:

from smugpy import SmugMug

API_KEY = "XXXXXXXXXXXXXXXXXXXXXXXXX"
OAUTH_SECRET = "YYYYYYYYYYYYYYYYYYYYYYY"

smugmug = SmugMug(api_key=API_KEY, oauth_secret=OAUTH_SECRET, app_name="TestApp")

smugmug.auth_getRequestToken()
raw_input("Authorize app at %s\n\nPress Enter when complete.\n" % (smugmug.authorize()))   
smugmug.auth_getAccessToken()

albums = smugmug.albums_get(NickName="williams")
for album in albums["Albums"]:
    print "%s, %s" % (album["id"], album["Title"])

Helping Out

If you notice any problems, please report them to the GitHub issue tracker at http://github.com/chrishoffman/smugpy/issues.

License

Smugpy is released under the MIT license.

Something went wrong with that request. Please try again.