Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Parsons Mailchimp connector #239

Merged
merged 29 commits into from
May 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
2003cba
Create Parsons Mailchimp connector
SorenSpicknall May 6, 2020
db20a8f
pep8 compliance
SorenSpicknall May 6, 2020
7fda770
pep8 compliance
SorenSpicknall May 6, 2020
4b1a3e0
Added RST documentation for Mailchimp class
SorenSpicknall May 7, 2020
70c6309
Used Parsons check_env for API key in __init__
SorenSpicknall May 7, 2020
835df40
Substituted f-strings where appropriate
SorenSpicknall May 7, 2020
462ebf0
pep8 compliance
SorenSpicknall May 7, 2020
b1d33cd
Completed docstrings for three functions
SorenSpicknall May 7, 2020
41330c0
Completed docstrings
SorenSpicknall May 8, 2020
1388cea
pep8 compliance
SorenSpicknall May 8, 2020
9438212
Removed transform_table function (not directly in use within Parsons)
SorenSpicknall May 11, 2020
3963880
Initial testing structure (functionality incomplete)
SorenSpicknall May 12, 2020
3379b9e
Fixed syntax and boolean references
SorenSpicknall May 12, 2020
4f9d368
Fixed API key structure
SorenSpicknall May 12, 2020
e981508
Continued work on test JSON
SorenSpicknall May 12, 2020
6c9dcd1
Fixed incorrectly formatted booleans
SorenSpicknall May 12, 2020
e285ced
Added args for function calls
SorenSpicknall May 12, 2020
e0915ba
Fixed references to copy/pasted functions
SorenSpicknall May 12, 2020
8a3e794
Testing URI fixes
SorenSpicknall May 13, 2020
92e27df
Added members JSON to tests
SorenSpicknall May 13, 2020
489bf29
Added unsubscribe data to expected JSON
SorenSpicknall May 13, 2020
1fc3958
Fixed stray punctuation
SorenSpicknall May 13, 2020
278d8f4
Fixed punctuation
SorenSpicknall May 13, 2020
c4012a4
Added some basic asserts
SorenSpicknall May 13, 2020
16645b3
Added Mailchimp to __init__.py
SorenSpicknall May 13, 2020
d9e1550
Return empty tables instead of None
SorenSpicknall May 13, 2020
72ba0c2
Fixed Mailchimp references in __init__.py
SorenSpicknall May 13, 2020
ed95271
Merge branch 'master' into mailchimp_connector
SorenSpicknall May 13, 2020
68f0a87
Merge branch 'master' into mailchimp_connector
May 13, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ Indices and tables
google_sheets
google_cloud
hustle
mailchimp
mobilize_america
newmode
ngpvan
Expand Down
32 changes: 32 additions & 0 deletions docs/mailchimp.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Mailchimp
=========

`Mailchimp <https://www.mailchimp.com>`_ is a platform used for creating and sending mass emails.
`The Mailchimp API <https://developers.braintreepayments.com/>`_ allows users to interact with data from existing
email campaigns under their account and to configure further campaigns; this Parsons integration focuses on accessing
information about previous email campaigns and the recipients of those campaigns.

***********
Quick Start
***********

.. code-block:: python

from parsons import Mailchimp

mc = Mailchimp()

# Get all recipient lists under a Mailchimp account
lists = mc.get_lists()

# Get campaigns sent since the beginning of 2020
recent_campaigns = mc.get_campaigns(since_send_time='2020-01-01T00:00:00Z')

# Get all unsubscribes from a campaign
unsubscribes = mc.get_unsubscribes('dd693a3e74')

***
API
***
.. autoclass :: parsons.mailchimp.Mailchimp
:inherited-members:
6 changes: 4 additions & 2 deletions parsons/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
from parsons.newmode.newmode import Newmode
from parsons.databases.mysql.mysql import MySQL
from parsons.rockthevote.rtv import RockTheVote
from parsons.mailchimp.mailchimp import Mailchimp
from parsons.zoom.zoom import Zoom
from parsons.action_network.action_network import ActionNetwork

Expand Down Expand Up @@ -78,9 +79,10 @@
'Newmode',
'MySQL',
'RockTheVote',
'Mailchimp',
'Zoom',
'ActionNetwork'
]
'ActionNetwork',
]

# Define the default logging config for Parsons and its submodules. For now the
# logger gets a StreamHandler by default. At some point a NullHandler may be more
Expand Down
5 changes: 5 additions & 0 deletions parsons/mailchimp/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from parsons.mailchimp.mailchimp import Mailchimp

__all__ = [
'Mailchimp'
]
391 changes: 391 additions & 0 deletions parsons/mailchimp/mailchimp.py

Large diffs are not rendered by default.

Empty file added test/test_mailchimp/__init__.py
Empty file.
Loading