Skip to main content

Reloop Python SDK

Project description

Reloop Python SDK

The official Python SDK for Reloop, modeled after the Stripe Python SDK with snake_case parameters and typed resource responses.

Requirements

  • Python 3.9 or higher

Installation

pip install reloop-email

Getting Started

from reloop_email import Reloop

reloop = Reloop(api_key="re_123456789")
# or
reloop = Reloop.client("re_123456789")

API Keys

reloop = Reloop(api_key="rl_123456789")

reloop.api_keys.list(page=1, limit=10)

reloop.api_keys.create(
    name="Production key",
    enabled=True,
    rate_limit_enabled=True,
)

reloop.api_keys.get("key_123456789")
reloop.api_keys.update("key_123456789", name="Renamed key")
reloop.api_keys.rotate("key_123456789")
reloop.api_keys.disable("key_123456789")
reloop.api_keys.pause("key_123456789")
reloop.api_keys.enable("key_123456789")
reloop.api_keys.delete("key_123456789")

Domains

Add, verify, and manage sending domains. Request parameters use snake_case; responses expose snake_case attributes.

reloop = Reloop(api_key="rl_123456789")

created = reloop.domain.create(
    domain="send.example.com",
    custom_return_path="inbound",
    click_tracking=True,
    open_tracking=True,
    tls="opportunistic",
    sending_email=True,
    receiving_email=True,
)

domains = reloop.domain.list(page=1, limit=10, status="active")
one = reloop.domain.get("domain_123456789")

reloop.domain.update(
    "domain_123456789",
    click_tracking=False,
    sending_email=True,
)

reloop.domain.verify("domain_123456789")

reloop.domain.forward_dns("domain_123456789", email="admin@example.com")

nameservers = reloop.domain.get_nameservers("domain_123456789")
print(nameservers.dns_provider, nameservers.nameservers)

reloop.domain.delete("domain_123456789")

Contacts

Manage contacts, custom properties, groups, and channels. Methods accept snake_case keyword arguments and return resource objects with snake_case attributes.

Create a contact

reloop = Reloop(api_key="re_123456789")

contact = reloop.contacts.create(
    email="steve.wozniak@gmail.com",
    first_name="Steve",
    last_name="Wozniak",
    unsubscribed=False,
)

print(contact.email)
print(contact.first_name)

List and update contacts

contacts = reloop.contacts.list(page=1, limit=10)
print(contacts.contacts, contacts.total)

reloop.contacts.update(
    "cont_123456789",
    first_name="Steve",
    unsubscribed=False,
)

Groups and channels

reloop.contacts.groups.add_contact(
    "grp_123456789",
    contact_id="cont_123456789",
)

reloop.contacts.channels.create(
    name="Product Updates",
    default_subscription="opt_in",
)

Error Handling

from reloop_email import Reloop, ReloopApiError

reloop = Reloop(api_key="re_123456789")

try:
    reloop.contacts.get("cont_invalid")
except ReloopApiError as error:
    print(error.status_code, error.body)

Context Manager

with Reloop(api_key="re_123456789") as reloop:
    reloop.contacts.list(limit=10)

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

reloop_email-0.2.0.tar.gz (7.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

reloop_email-0.2.0-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file reloop_email-0.2.0.tar.gz.

File metadata

  • Download URL: reloop_email-0.2.0.tar.gz
  • Upload date:
  • Size: 7.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for reloop_email-0.2.0.tar.gz
Algorithm Hash digest
SHA256 d6653cf7166cd626c58b5d8ea6e63351bbebd9ac5772d370f7dc5963dd8315e4
MD5 98f56f4d760690c969940aeb9a733331
BLAKE2b-256 4c0329c453635dbb843deff7c4fc951beda1aa1fdbec23a78d7ac166fbe565bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for reloop_email-0.2.0.tar.gz:

Publisher: publish.yml on reloop-labs/reloop-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file reloop_email-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: reloop_email-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for reloop_email-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1678d0ddbc34beea04b0000915e388cbba6ce30745eeffd8804f780a2f76ded9
MD5 cb5f1a89d377ef63d6099e558c35b6bd
BLAKE2b-256 68cb8ced1269e32e91e87d6cc2c92b6314e9e81cd00a643c75bc1abcadd8a9eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for reloop_email-0.2.0-py3-none-any.whl:

Publisher: publish.yml on reloop-labs/reloop-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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