Skip to main content

Official Python SDK for Pingram - Send notifications via Email, SMS, Push, In-App, and more

Project description

Pingram Python SDK

Official Python SDK for Pingram. Send notifications via Email, SMS, Push, In-App, and more from your server-side Python code.

Requirements

  • Python 3.9+
  • Dependencies: httpx, pydantic, python-dateutil, typing-extensions (installed automatically)

Installation

pip install pingram-python

To install from source (e.g. from the GitHub repo):

pip install -e sdks/python

Quick start

Use the Pingram client with your API key, then call send() or the namespaced APIs (user, users, logs, etc.).

import asyncio
from pingram import Pingram, SenderPostBody, SenderPostBodyTo

async def main():
    # API key (e.g. pingram_sk_...) or JWT; optional region ("us" | "eu" | "ca")
    async with Pingram(api_key="pingram_sk_...") as client:
        # Send a notification
        body = SenderPostBody(
            notification_id="your_notification_id",
            to=SenderPostBodyTo(id="user_123"),
        )
        response = await client.send(sender_post_body=body)
        print(response)

        # Or use namespaced APIs (same as Node: client.user, client.users, client.logs, ...)
        # user = await client.user.user_get_user(account_id="...", user_id="...")
        # logs = await client.logs.logs_query_logs(...)

asyncio.run(main())

You can also pass a config dict: Pingram({"api_key": "pingram_sk_...", "region": "eu"}). For full API coverage, use client.send, client.user, client.users, client.logs, client.templates, client.environments, and the other APIs.

Links

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

pingram_python-1.0.12.tar.gz (130.8 kB view details)

Uploaded Source

Built Distribution

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

pingram_python-1.0.12-py3-none-any.whl (404.3 kB view details)

Uploaded Python 3

File details

Details for the file pingram_python-1.0.12.tar.gz.

File metadata

  • Download URL: pingram_python-1.0.12.tar.gz
  • Upload date:
  • Size: 130.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for pingram_python-1.0.12.tar.gz
Algorithm Hash digest
SHA256 516966ffa70f15133255dcbcd3a6e7a6a08c238a2f6c63cc71e5156b6d18a177
MD5 def1a30e1d543f7348ce95f6ba9b07c5
BLAKE2b-256 7683fbcb97a5a9e1c00a666a47f91153edf4aa0e11bbca017494ec7906fb2225

See more details on using hashes here.

File details

Details for the file pingram_python-1.0.12-py3-none-any.whl.

File metadata

  • Download URL: pingram_python-1.0.12-py3-none-any.whl
  • Upload date:
  • Size: 404.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for pingram_python-1.0.12-py3-none-any.whl
Algorithm Hash digest
SHA256 b52799c25341fd58b9448756ff68414fb0f6a74cd7da4c1f6cb4f96be8761a65
MD5 d11dbfea18db3f3d517bde25ff4727a8
BLAKE2b-256 59b8d02a5e2de60a91c50138731291e016016d39c71d7160f958d5474d8ec46d

See more details on using hashes here.

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