Spotler SDK
raw JSON → 0.3.2 verified Sat May 09 auth: no python
Python SDK for the Spotler email marketing platform. Current version 0.3.2, requires Python >=3.12 and <4.0. Early-stage package with infrequent releases.
pip install spotler-sdk Common errors
error ModuleNotFoundError: No module named 'spotler' ↓
cause Incorrect import path: 'spotler' instead of 'spotler_sdk'.
fix
Use
from spotler_sdk import SpotlerClient. error spotler_sdk.exceptions.AuthenticationError: Invalid API Key ↓
cause The API key provided to SpotlerClient is incorrect or missing.
fix
Ensure SPOTLER_API_KEY environment variable is set correctly, or pass api_key directly.
Warnings
gotcha The package name on PyPI is 'spotler-sdk' but the import module uses underscore: 'spotler_sdk'. ↓
fix Use `from spotler_sdk import ...`.
deprecated No deprecation warnings known; however, the SDK is very early (v0.3.2) and breaking changes may occur without notice. ↓
fix Pin exact version in requirements: spotler-sdk==0.3.2
breaking Python 3.12 minimum required; cannot install on Python 3.11 or earlier. ↓
fix Upgrade Python to >=3.12.
Imports
- SpotlerClient wrong
from spotler import SpotlerClientcorrectfrom spotler_sdk import SpotlerClient - Mailing wrong
import Mailing from spotler_sdkcorrectfrom spotler_sdk.models import Mailing
Quickstart
from spotler_sdk import SpotlerClient
client = SpotlerClient(
base_url='https://api.spotler.com',
api_key=os.environ.get('SPOTLER_API_KEY', '')
)
try:
mailings = client.mailings.list()
print(mailings)
except Exception as e:
print(f'Error: {e}')