Skip to main content

mailerlite-python

mailerlite-python is an API wrapper for MailerLite, written in Python

Installing

pip install mailerlite-python

Usage

from mailerlite.client import Client
client = Client('API_KEY')

Subscribers

List Subscribers

subs = client.list_subscribers(params=None)
# Optional params (dict):
# filter[status] = Must be one of the possible statuses: active, unsubscribed, unconfirmed, bounced or junk.
# limit = Defaults to 25
# page = Defaults to 1

Create Subscriber

subscriber = {
    "email": "carlos@burgos.com",
    "fields": {
        "name": "Carlos",
        "last_name": "Burgos",
        "city": "Bogotá",
    }
}
sub = client.create_subscriber(subscriber)
# If user email already exists, updates existing subscriber.

Fetch Subscriber

# Reference can be either email or ID
subscriber = client.fetch_subscriber(reference)

Delete Subscriber

client.delete_subscriber(subscriber_id)

Subscribe Subscriber

client.activate_subscriber(subscriber_id)

Unsubscribe Subscriber

client.unsubscribe_subscriber(subscriber_id)

Assign Subscriber to a Group

client.assign_to_group(subscriber_id, group_id)

List Subscriber fields

fields = client.list_subscriber_fields()

List Groups

groups = client.list_groups(params=None)
# Optional params (dict):
# filter[name] = Returns partial matches
# limit = An account can have at most a 250 groups
# page = Defaults to 1
# sort = Can be one of: name, total, open_rate, click_rate, created_at. Defaults to ascending order; prepend (-)

Webhooks

List all webhooks

webhooks = client.list_webhooks()

Create webhook

webhook = {
    "name": "first webhook",
    "events": ["subscriber.created"],
    "url": "http://www.cartwright.info/eligendi-soluta-corporis-in-quod-ullam"
}
webhook_created = client.create_webhook(webhook)

Delete webhook

client.delete_webhook(webhook_id)

Metadata

Release files for mailerlite-python 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mailerlite-python 0.1.2
File Size Uploaded
mailerlite_python-0.1.2.tar.gz 3.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for mailerlite-python 0.1.2
File Interpreter ABI Platform
mailerlite_python-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 8.3 kB

Release files / mailerlite_python-0.1.2.tar.gz

Download URL mailerlite_python-0.1.2.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
f88764cf1662753df030a2b27cd137ea33fe9f5d969c96e827823f0b682a8f7e
BLAKE2b-256 checksum
How to use checksums
4ee61e31d0711656dd45a5173b5a742b9114c59ab0b3ea44cf56c1a5e5f65511
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release files / mailerlite_python-0.1.2-py3-none-any.whl

Download URL mailerlite_python-0.1.2-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c5448944ca885e2397877fcd089fd8998495e9ef5ccc3ca798fbb8f4c1f3be25
BLAKE2b-256 checksum
How to use checksums
10b470519551053116f340fdccbe90c5d5f5eea6fed421bce9f758f49d0ddf32
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.9

Release history Release notifications | RSS feed

This release

0.1.2 This release

2 release files

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page