New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

mailsnake

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mailsnake

MailChimp API v1.3, STS, Export, Mandrill wrapper for Python.

  • 1.6.4
  • PyPI
  • Socket score

Maintainers
1

MailSnake

MailSnake is a Python wrapper for MailChimp API 1.3 <http://www.mailchimp.com/api/1.3/>_ (as well as the STS API <http://apidocs.mailchimp.com/sts/1.0/>, Export API <http://apidocs.mailchimp.com/export/>, and Mandrill API <http://mandrillapp.com/api/docs/>_) (Now with support for Python 3)

Installation

::

pip install mailsnake

Usage

Basic Ping


::

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

Mandrill Ping

::

mapi = MailSnake('YOUR MANDRILL API KEY', api='mandrill')
mapi.users.ping() # returns "PONG!"

STS Example


::

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


Catching 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='name@email.com')

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc