Skip to main content

Wrapper library for Mailchimp's 3.0 API

Project description

Python wrapper for Mailchimp’s 3.0+ API

Installation

Install via pip:

pip install pyilchimp

Usage

Basic example

First connect to an account:

from pyilchimp.mailchimp_manager import MailchimpManager

mc = MailchimpManager(api_key='1qaz2wsx3edc4rfv5tgb667yhn', server='us1')

Now we can make requests:

campaigns = mc.campaigns.all()

recent_campaigns = mc.campaigns.all(filters={'sort_dir': 'DESC', 'count': 20})

Managers and resources

If you’ve ever used Django’s ORM, Pyilchimp is structured in a similar way. Resources have managers which can find and return objects, such as a CampaignManager finding and returning campaigns. The name of the manager is the lower case pluralised form of each resource and provides a .get() and .all() method. get() can return a single instance when provided an id, while all() will return all objects matching a provided filter, or the last 10 by default.

Mailchimp actions

Mailchimp provides actions that do not fit into standard RESTful API guidelines. Making use of these actions map to methods with the same name for each resource.

campaign = mc.campaigns.get('123123123c')
campaign.pause()

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

pyilchimp-0.1.1.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file pyilchimp-0.1.1.tar.gz.

File metadata

  • Download URL: pyilchimp-0.1.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pyilchimp-0.1.1.tar.gz
Algorithm Hash digest
SHA256 940b3f95cf7207ecee794cda1d31b595487ee688ff9c737108e88158a9260007
MD5 37a53177d894dd19ad3f7a8dcded5906
BLAKE2b-256 40762f772c5d286c24e99f8a66152ac610efc599046c2e4231da87625bdc160a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page