Skip to content

Python library for SmugMug API that supports Oauth and Google App Engine

License

Notifications You must be signed in to change notification settings

brettcoon/keyword-fixer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Keyword-fixer

A simple script based on smugpy to scrub keywords in SmugMug galleries.

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.

About

Python library for SmugMug API that supports Oauth and Google App Engine

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%