Skip to content

themartorana/mailsnake

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MailSnake

MailSnake is a Python wrapper for MailChimp APIs.

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.'

The default API is MCAPI, but STS or Export can be used by supplying an api argument set to 'sts' or 'export' respectively. Here's an example:

mcsts = MailSnake('YOUR MAILCHIMP API KEY', api='sts')
mcsts.GetSendQuota() # returns something like {'Max24HourSend': '10000.0', 'SentLast24Hours': '0.0', 'MaxSendRate': '5.0'}

Note

API parameters must be passed by name. For example:

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

API Documentation

Note that in order to use the STS API you first need to enable the Amazon Simple Email Service integration in MailChimp.

MailChimp API v1.3 documentation

MailChimp STS API v1.3 documentation

MailChimp Export API v1.0 documentation

About

MailChimp API v1.3 wrapper for Python

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%