Skip to main content

mailchimp api v3 client

Project description

[![Coverage Status](](
[![CI Status](](

# wingmonkey
mailchimp api v3 client

mailchimp v3 api reference documentation:

### Settings

To be able to make calls to mailchimp without having to initialize a custom MailChimpSession yourself make sure that at least following environment variable is set (or added to a .env file):



For more advanced usage you can pass a custom MailChimpSession to the serializers and functions:

from wingmonkey.mailchimp_session import MailChimpSession
from wingmonkey.lists import ListSerializer

session = MailChimpSession(api_endpoint=<YOUR MAILCHIMP BASE URL>, api_key=<YOUR MAILCHIMP API KEY>)
list_serializer = ListSerializer(session=session)


### Some more usage examples:

#### getting list info

from wingmonkey.lists import ListSerializer

list_serializer = ListSerializer()
list_id = 'A_VALID_LIST_ID'

my_list =

name =
total_subscribers = my_list.stats['member_count']
unsubscribe_count = my_list.stats['unsubscribe_count']
#### creating new member

from wingmonkey.members import Member, MemberSerializer

email_address = ''
merge_fields = {FNAME: 'Ceasar', LNAME: 'Chimp'}
language = 'en'
list_id = 'A_VALID_LIST_ID'

member_to_add = Member(

member_serializer = MemberSerializer()

newly_added_member = member_serializer.create(list_id=list_id, instance=member_to_add)

#### get all members of a list


from wingmonkey.async_operations import get_all_members_async
from datetime import datetime, timedelta

list_id = 'A_VALID_LIST_ID'

* all members
all_list_members = get_all_members_async(list_id=list_id)

* all members updated since specific date (take care to use the correct string format for datetime)
date_since = datetime.strftime( - timedelta(days=1), '%Y-%m-%dT%H:%M:%S')
extra_params = {'since_last_changed': date_since }
all_updated_members_since_yesterday = get_all_members_async(list_id=list_id, extra_params=extra_params)

#### batch update of a large list of members
* This will return a list of corresponding batch operation resources (1 for every 500 members)

from wingmonkey.async_operations import batch_update_members_async
list_id = 'A_VALID_LIST_ID'

batch_operation_resource_list = batch_update_members_async(list_id=list_id, member_list=member_list)

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

wingmonkey-0.1.21.tar.gz (28.6 kB view hashes)

Uploaded source

Built Distribution

wingmonkey-0.1.21-py3-none-any.whl (39.7 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page