Skip to content

Latest commit

 

History

History
43 lines (34 loc) · 867 Bytes

README.md

File metadata and controls

43 lines (34 loc) · 867 Bytes

MailSnake

MailSnake is a Python wrapper for MailChimp API 1.3

Installation

pip install mailsnake

Usage

from mailsnake import MailSnake
from mailsnake.exceptions import *

ms = MailSnake('YOUR MAILCHIMP API KEY')
try:
    ms.ping() # returns "Everything's Chimpy!"
except MailSnakeException:
    print 'An error occurred. :('

You can also catch specific errors:

ms = MailSnake('my_wrong_mailchimp_api_key_that_does_not_exist')
try:
    ms.ping() # returns "Everything's Chimpy!"
except InvalidApiKeyException:
    print 'You have a bad API key, sorry.'

Note

API parameters must be passed by name. For example:

ms.listMemberInfo(id='YOUR LIST ID', email_address='[email protected]')

MailChimp API v1.3 documentation

http://www.mailchimp.com/api/1.3/