Skip to main content

A client library for accessing Campaigner EDAPI

Project description

campaigner-edapi-client

A Python client library for accessing the Campaigner EDAPI.

Installation

pip install campaigner-edapi-client

Or with uv:

uv add campaigner-edapi-client

Usage

First, create a client:

from campaigner_edapi_client import AuthenticatedClient

client = AuthenticatedClient(base_url="https://edapi.campaigner.com", token="your-api-key")

Now call your endpoint and use your models:

from campaigner_edapi_client.api.campaigns import get_campaigns
from campaigner_edapi_client.types import Response

with client as client:
    campaigns = get_campaigns.sync(client=client)
    # or if you need more info (e.g. status_code)
    response: Response = get_campaigns.sync_detailed(client=client)

Or do the same thing with an async version:

async with client as client:
    campaigns = await get_campaigns.asyncio(client=client)
    response = await get_campaigns.asyncio_detailed(client=client)

Available API Modules

All endpoint functions live under campaigner_edapi_client.api:

Module Description
bounces Bounce management
campaigns Campaign CRUD and activation
creatives Email creative/template management
database Database field operations
file_imports File import operations
filters Subscriber filter management
ftp FTP operations
image_library Image library management
image_upload Image upload operations
lists Mailing list management
orders Order management
ping API health check
products Product catalog
product_categories Product category management
publications Publication management
relay_sends Transactional/relay sends
short_urls URL shortening
smtp SMTP relay
sources Source tracking
subscribers Subscriber management
suppression_lists Suppression list management
workflows Automation workflow management

API Pattern

Every path/method combo becomes a Python module with four functions:

Function Description
sync Blocking request, returns parsed data or None
sync_detailed Blocking request, returns full Response with status code
asyncio Async version of sync
asyncio_detailed Async version of sync_detailed

All path/query params and request bodies become function arguments.

SSL Configuration

Custom certificate bundle:

client = AuthenticatedClient(
    base_url="https://edapi.campaigner.com",
    token="your-api-key",
    verify_ssl="/path/to/certificate_bundle.pem",
)

Advanced Customization

You can customize the underlying httpx.Client or httpx.AsyncClient:

from campaigner_edapi_client import AuthenticatedClient

def log_request(request):
    print(f"{request.method} {request.url}")

def log_response(response):
    print(f"{response.status_code}")

client = AuthenticatedClient(
    base_url="https://edapi.campaigner.com",
    token="your-api-key",
    httpx_args={"event_hooks": {"request": [log_request], "response": [log_response]}},
)

Building / Publishing

This package is automatically published to PyPI via GitHub Actions when the version in pyproject.toml is bumped on main. To release a new version:

  1. Update version in pyproject.toml
  2. Merge to main
  3. The release workflow will create a git tag and publish to PyPI

For local development in another project:

uv add campaigner-edapi-client --dev --editable ../campaigner/sdk/python

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

campaigner_edapi_client-1.1.1.tar.gz (142.7 kB view details)

Uploaded Source

Built Distribution

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

campaigner_edapi_client-1.1.1-py3-none-any.whl (830.5 kB view details)

Uploaded Python 3

File details

Details for the file campaigner_edapi_client-1.1.1.tar.gz.

File metadata

  • Download URL: campaigner_edapi_client-1.1.1.tar.gz
  • Upload date:
  • Size: 142.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for campaigner_edapi_client-1.1.1.tar.gz
Algorithm Hash digest
SHA256 5b3fbc180e410d75edf141cd7a40fe336f8157d7636b4f62f99e3c96e233b0f6
MD5 aa6197beb4b1ca4fffb1c3290df4f529
BLAKE2b-256 c29fd6bf8a3e55e40fce0314be30b197ba6e53a0704b9abf3a0df43ff1e031f3

See more details on using hashes here.

Provenance

The following attestation bundles were made for campaigner_edapi_client-1.1.1.tar.gz:

Publisher: release.yml on MontereyFinancialServices/campaigner

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

File details

Details for the file campaigner_edapi_client-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for campaigner_edapi_client-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 62bd104fb1e14c9aacf4d5fd72deab51b03e6b2f3fecaa9de2845e13a714d4c6
MD5 e35e556d2cee49d641381a9754c02cf3
BLAKE2b-256 dd66f2edf1a3069ffbf8e9656dcb931027ad05f472c11d28e33a663b1694b47b

See more details on using hashes here.

Provenance

The following attestation bundles were made for campaigner_edapi_client-1.1.1-py3-none-any.whl:

Publisher: release.yml on MontereyFinancialServices/campaigner

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