My favorites | Sign in
Project Logo
                
Search
for
Updated Mar 25, 2009 by bzim...@ziclix.com
PySmugRC  
Description of the .pysmurc file.

Introduction

Rather than type the email address, password and API key over and over pysmug can read the values from a .pysmurc file found in the user's home directory.

Details

The file format has changed significantly with the v0.4 release.

v0.4

The format is a standard configuration parseable by ConfigParser. The main section pysmug is required. The key login references which section to use for authentication with SmugMug. The key smugmug is optional and can specify an alternate SmugMug class to instantiate. This is an example file:

[pysmug]
login=login_withHash
smugmug=pysmug.SmugTool

[login_withPassword]
APIKey = <my api key>
emailAddress = <my email address>
password = <my password>

[login_withHash]
APIKey = <my api key>
userId = <my user id>
passwordHash = <my password hash>

[login_anonymously]
APIKey = <my api key>

Some items to note, userId is an integer retrieved from SmugMug after a successful login_withPassword invocation is performed -- it is not your email address.

v0.3

The format of the file looks like this:

{
  "APIKey":<my api key>,
  "EmailAddress":<my email address>,
  "Password":<password>
}

pysmug.login

When the pysmug method login() is invoked, the file is parsed, the contents of the authentication section are passed to the appropriate method and a SmugMug instance (or alternative if configured in v0.4+) is returned if the authentication was successful.

>>> import pysmug
>>> m = pysmug.login()

Sign in to add a comment
Hosted by Google Code