batch-mailchimp


Namebatch-mailchimp JSON
Version 1.2.2 PyPI version JSON
download
home_pagehttps://github.com/FullFact/python-batchmailchimp
SummaryA python client for MailChimp Marketing API, with batch support
upload_time2023-07-05 21:30:40
maintainer
docs_urlNone
authorAndy Lulham
requires_python
licenseMIT
keywords mailchimp marketing api client wrapper
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Python BatchMailchimp
=====================

.. image:: https://img.shields.io/pypi/v/batch-mailchimp.svg
    :alt: PyPI Package latest release
    :target: https://pypi.org/project/batch-mailchimp/

.. image:: https://img.shields.io/pypi/l/batch-mailchimp.svg
    :alt: License
    :target: https://pypi.org/project/batch-mailchimp/

A light wrapper around `mailchimp-marketing <https://pypi.org/project/mailchimp-marketing/>`__ that makes it easier to use batch operations.

Getting Started
---------------

Installation
~~~~~~~~~~~~

::

   pip install batch-mailchimp

Usage
~~~~~

This can be used as a drop-in replacement for mailchimp-marketing –
just change the import at the top, and everything should work the same:

.. code:: python

   import batch_mailchimp as MailchimpMarketing

   client = MailchimpMarketing.Client({
       "api_key": "YOUR_API_KEY",
   })

The additional functionality comes when we initialise the client with ``batch=True``:

.. code:: python

   import batch_mailchimp as MailchimpMarketing

   client = MailchimpMarketing.Client({
       "api_key": "YOUR_API_KEY",
       "batch": True,
   })

If we do this, operations are stored up in the client, to be run later. For example:

.. code:: python

   # Fetch all MailChimp lists
   client.lists.get_all_lists()

All new operations will be added to the batch. When we’re ready, we can run all the operations in the batch:

.. code:: python

   batch = batch_client.batches.run()

We can check the batch’s status using:

.. code:: python

   batch.status(refresh=True)

Once it has finished, we can get the response with:

.. code:: python

   response = batch.response()
   response.body

API Structure and Endpoints
---------------------------

The API structure and endpoints match that of `mailchimp-marketing <https://mailchimp.com/developer/marketing/api/>`__. You should refer to their documentation for usage.

Support
-------

If you are having issues, please `create an issue <https://github.com/FullFact/python-batchmailchimp/issues>`__.

License
-------

The project is licensed under the MIT License.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/FullFact/python-batchmailchimp",
    "name": "batch-mailchimp",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "mailchimp marketing api client wrapper",
    "author": "Andy Lulham",
    "author_email": "andy.lulham@fullfact.org",
    "download_url": "https://files.pythonhosted.org/packages/98/44/649b40c7883e994949cf1acef652cedfba38c3a1e6c0371a1dae15d4e5a5/batch-mailchimp-1.2.2.tar.gz",
    "platform": null,
    "description": "Python BatchMailchimp\n=====================\n\n.. image:: https://img.shields.io/pypi/v/batch-mailchimp.svg\n    :alt: PyPI Package latest release\n    :target: https://pypi.org/project/batch-mailchimp/\n\n.. image:: https://img.shields.io/pypi/l/batch-mailchimp.svg\n    :alt: License\n    :target: https://pypi.org/project/batch-mailchimp/\n\nA light wrapper around `mailchimp-marketing <https://pypi.org/project/mailchimp-marketing/>`__ that makes it easier to use batch operations.\n\nGetting Started\n---------------\n\nInstallation\n~~~~~~~~~~~~\n\n::\n\n   pip install batch-mailchimp\n\nUsage\n~~~~~\n\nThis can be used as a drop-in replacement for mailchimp-marketing \u2013\njust change the import at the top, and everything should work the same:\n\n.. code:: python\n\n   import batch_mailchimp as MailchimpMarketing\n\n   client = MailchimpMarketing.Client({\n       \"api_key\": \"YOUR_API_KEY\",\n   })\n\nThe additional functionality comes when we initialise the client with ``batch=True``:\n\n.. code:: python\n\n   import batch_mailchimp as MailchimpMarketing\n\n   client = MailchimpMarketing.Client({\n       \"api_key\": \"YOUR_API_KEY\",\n       \"batch\": True,\n   })\n\nIf we do this, operations are stored up in the client, to be run later. For example:\n\n.. code:: python\n\n   # Fetch all MailChimp lists\n   client.lists.get_all_lists()\n\nAll new operations will be added to the batch. When we\u2019re ready, we can run all the operations in the batch:\n\n.. code:: python\n\n   batch = batch_client.batches.run()\n\nWe can check the batch\u2019s status using:\n\n.. code:: python\n\n   batch.status(refresh=True)\n\nOnce it has finished, we can get the response with:\n\n.. code:: python\n\n   response = batch.response()\n   response.body\n\nAPI Structure and Endpoints\n---------------------------\n\nThe API structure and endpoints match that of `mailchimp-marketing <https://mailchimp.com/developer/marketing/api/>`__. You should refer to their documentation for usage.\n\nSupport\n-------\n\nIf you are having issues, please `create an issue <https://github.com/FullFact/python-batchmailchimp/issues>`__.\n\nLicense\n-------\n\nThe project is licensed under the MIT License.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A python client for MailChimp Marketing API, with batch support",
    "version": "1.2.2",
    "project_urls": {
        "Homepage": "https://github.com/FullFact/python-batchmailchimp"
    },
    "split_keywords": [
        "mailchimp",
        "marketing",
        "api",
        "client",
        "wrapper"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "69004679e54e9ccb0239deaf2a0974657131cc17b6d6899f7b0e8c4835b0470e",
                "md5": "5142401c7e97695ce28ded8f75e9a575",
                "sha256": "4e3e7f53407525479532b1d98f614b2ddb287079e8263f3657aea58e50ca9fd8"
            },
            "downloads": -1,
            "filename": "batch_mailchimp-1.2.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5142401c7e97695ce28ded8f75e9a575",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 6795,
            "upload_time": "2023-07-05T21:30:38",
            "upload_time_iso_8601": "2023-07-05T21:30:38.954405Z",
            "url": "https://files.pythonhosted.org/packages/69/00/4679e54e9ccb0239deaf2a0974657131cc17b6d6899f7b0e8c4835b0470e/batch_mailchimp-1.2.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9844649b40c7883e994949cf1acef652cedfba38c3a1e6c0371a1dae15d4e5a5",
                "md5": "726ac506f6d1ef0ad22e423dcfebe6fa",
                "sha256": "34d74bb72257d3a2f8d78c5cc624beafe04f2834f8e28590e8061450d3a3db77"
            },
            "downloads": -1,
            "filename": "batch-mailchimp-1.2.2.tar.gz",
            "has_sig": false,
            "md5_digest": "726ac506f6d1ef0ad22e423dcfebe6fa",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5765,
            "upload_time": "2023-07-05T21:30:40",
            "upload_time_iso_8601": "2023-07-05T21:30:40.381557Z",
            "url": "https://files.pythonhosted.org/packages/98/44/649b40c7883e994949cf1acef652cedfba38c3a1e6c0371a1dae15d4e5a5/batch-mailchimp-1.2.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-07-05 21:30:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "FullFact",
    "github_project": "python-batchmailchimp",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [],
    "lcname": "batch-mailchimp"
}
        
Elapsed time: 0.60439s