Python SDK
Python SDK
Sync client meridianads from GitLab Package Registry. No asyncio client in v1. This stub will mirror sdks/python/README.md.
Install
Public PyPI is out of v1. Point pip at the GitLab PyPI registry for this project, then install meridianads.
Python
# GitLab PyPI for yelle/saas/meridian-ads
pip install meridianadsServe, render, click
The Python client is synchronous only. HMAC signing stays inside the package. Fire impression after the creative is shown. Use click_url as the destination.
Python
import os
from meridianads import Client
client = Client(
app_key=os.environ["MERIDIAN_ADS_APP_KEY"],
secret=os.environ["MERIDIAN_ADS_SECRET"],
)
decision = client.serve("home", "user-42", {"country": "US", "plan": "pro"})
if decision is None:
pass # HTTP 204
else:
client.impression(decision)
href = decision.click_urlNext
Identifier contract and fail-closed segments describe the context map you send on each serve call.