Skip to main content

Official Python SDK for the Sandesh notification API.

Project description

sandesh-sdk

Official Python SDK for the Sandesh notification API.

License

This SDK is licensed under the MIT License.

See ../LICENSE.

Install

pip install sandesh-sdk

Quick start

from sandesh.sdk import Sandesh

client = Sandesh(
    base_url="https://your-sandesh-api.example.com",
    bearer_token="your_jwt_or_api_key",
)

result = client.events_trigger(
    {
        "name": "vendor-assessment-form-to-vendor",
        "to": {"subscriberId": "vendor-contact-1"},
        "payload": {
            "organisation": "Acme Corp",
            "vendor_name": "Globex",
            "assessment_name": "Vendor Risk Check",
            "due_date": "April 30, 2026",
            "url": "https://app.example.com/assessment?id=123",
        },
        "overrides": {
            "email": {
                "cc": ["risk@example.com"],
                "subject": "Reminder: Vendor Risk Check",
            }
        },
    }
)

print(result)

Covered methods

  • Events: strict and legacy trigger methods.
  • Subscribers: create/get/list/update/deactivate.
  • Notifications: create/list/get/seen/unseen/retry/resend.
  • Templates: list/create/get/update/delete/preview/validate.
  • Integrations and credentials.
  • Settings, SES helpers, stats, and health.

If your code currently uses Novu-style classes, switch imports only:

from sandesh.api import EventApi, SubscriberApi
from sandesh.dto import SubscriberDto

Publish to PyPI

  1. Build distribution files:
python -m pip install --upgrade build twine
python -m build
  1. Validate package metadata:
python -m twine check dist/*
  1. Upload to TestPyPI (recommended first):
python -m twine upload --repository testpypi dist/*
  1. Upload to PyPI:
python -m twine upload dist/*

Set credentials using environment variables before uploading:

  • TWINE_USERNAME=__token__
  • TWINE_PASSWORD=<your_pypi_api_token>

Build compiled wheel (Cython)

To ship a binary wheel with Cython-compiled SDK modules, build with SANDESH_BUILD_COMPILED=1.

Windows PowerShell:

$env:SANDESH_BUILD_COMPILED="1"
python -m pip install --upgrade build cython
python -m build --wheel

Standard source + wheel build (default, no Cython compilation):

Remove-Item Env:SANDESH_BUILD_COMPILED -ErrorAction Ignore
python -m build

Notes:

  • Compiled wheels require a local C/C++ toolchain (for example, Microsoft C++ Build Tools on Windows).
  • This raises reverse-engineering difficulty but cannot provide absolute code secrecy in Python packaging.

IDE / Pylance types (.pyi)

Core modules may ship as compiled extensions (.pyd). Type checkers cannot read those, so the package includes stub files (*.pyi) and py.typed for autocomplete and static analysis (EventApi, SubscriberApi, SubscriberDto, Sandesh, etc.).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

sandesh_sdk-0.3.7-cp312-cp312-win_amd64.whl (459.6 kB view details)

Uploaded CPython 3.12Windows x86-64

File details

Details for the file sandesh_sdk-0.3.7-cp312-cp312-win_amd64.whl.

File metadata

File hashes

Hashes for sandesh_sdk-0.3.7-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 1f3524147d42d385d6d7948de2e0245f4d9873b35ac8a3873140daf43ce44741
MD5 d553e3ec99d5027103b5461d2d74a31a
BLAKE2b-256 88ffdf77bc3c1875b4d9906e5937797e8af240a77519a06b6821d5716df81474

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