Skip to main content

Real-time notification and messaging SDK for Python. WebSocket & HTTP, auth, binary frames, AI, RAG, and workflows.

Project description

DNotifier Python SDK

DNotifier is a real-time notification and messaging SDK for Python 3.9+. It supports WebSocket and HTTP transports, binary streaming, framed packets, an AI pipeline, knowledge-base (RAG) APIs, optional session logging, and multi-step workflows with agents and observability.


Features

  • WebSocket and HTTP transport
  • Secure authentication handshake
  • Real-time messaging (text and binary)
  • Large payloads with automatic chunking and reassembly
  • AI: send_ai, fetch_ai_history, semantic search
  • Knowledge base: add, update, get, list, delete, and search documents
  • Chat history fetch and delete
  • Optional SDK session logging (logs=True)
  • Workflows: named agents, sequential pipelines, dashboard observability
  • Plan limits from auth (get_plan_limits)

Installation

pip install dnotifier

Quick start

import asyncio
from dnotifier import DNotifier

async def main():
    notifier = DNotifier(
        app_id="your-app-id",
        secret="your-app-secret",
        transport="ws",  # or "http"
        user_id="user-123",
        on_connected=lambda: print("Connected"),
        on_message=lambda msg: print(msg.payload.to_json()),
        on_disconnected=lambda **kw: print("Disconnected", kw),
    )

    await notifier.connect()

    await notifier.send(
        sender_id="user-123",
        receiver_id="user-456",
        data={"type": "text", "text": "Hello from DNotifier"},
    )

    await notifier.disconnect()

asyncio.run(main())

Connection options

Parameter Type Description
app_id str Your DNotifier application id
secret str Application secret
transport "ws" | "http" WebSocket for realtime; HTTP for RPC-style AI/RAG
user_id str End-user or agent id for auth and routing
logs bool Enable SDK session logging (default False)
url str WebSocket URL override (default production wss://api.dnotifier.com/ecs/ws)
on_connected callable Called after successful connect
on_message callable Called for each incoming message
on_disconnected callable Called on disconnect (code, reason)

API overview

Method Description
connect() Authenticate and open transport
disconnect() Close WebSocket connection
send(...) Send realtime message
send_binary(...) Send binary payload (WebSocket)
send_ai(...) Send to AI pipeline
fetch_ai_history(...) Fetch AI conversation history
delete_ai_history_message(...) Delete one AI history entry
fetch_chat_history(...) Request chat history
delete_chat_history_message(...) Delete one chat message
search(...) Semantic / vector search
add_document(...) Add RAG document
update_document(...) Update RAG document
delete_document(...) Delete RAG document
list_documents(...) List RAG documents
get_document(...) Get RAG document + chunks
get_plan_limits() Plan limits from last auth
run_workflow(...) Run a registered workflow

Workflows

from dnotifier import DNotifier, Workflow, define_agent

researcher = define_agent(
    name="researcher",
    run=lambda ctx: ctx.send_ai(message=ctx.input, label="Research"),
)

workflow = Workflow(
    name="qa-pipeline",
    observability=True,
    entry=lambda ctx: ctx.run_agent("researcher"),
)
workflow.register_agent("researcher", researcher)

async def main():
    notifier = DNotifier(...)
    await notifier.connect()
    result = await notifier.run_workflow(workflow=workflow, input_data="What is RAG?")
    print(result)

License

Proprietary — see LICENSE.

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

dnotifier-1.0.1.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

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

dnotifier-1.0.1-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

Details for the file dnotifier-1.0.1.tar.gz.

File metadata

  • Download URL: dnotifier-1.0.1.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for dnotifier-1.0.1.tar.gz
Algorithm Hash digest
SHA256 d4d6db167b5a05449213c15e89920dd14fcfba549ea7523c66b06b75821a091e
MD5 f12e8fe14d57a73e475cedcadf77b789
BLAKE2b-256 3084cf014d417187333bc98d38883e9ef91ce72baa2d23630893108f3ac570da

See more details on using hashes here.

File details

Details for the file dnotifier-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: dnotifier-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 23.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for dnotifier-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 079857432ce7a3f3751c0e6f6865b2dd43550815640d21603dae3f893bc56872
MD5 8ad5d2c0b7d8e2ead9aebde9466301f2
BLAKE2b-256 4ca72b19bf3ae13115ea931abe4c66178b09a1f78e581dcd12ea1b59550c9b92

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