Skip to main content

Python SDK for Nevo — the inbound event gateway.

Project description

Nevo Python Library

PyPI version Python versions License

The official Python library for Nevo.

Documentation

See the Python quickstart and the events reference.

Requirements

  • Python 3.10+

Installation

pip install nevo-sdk

The import path stays nevo — only the distribution name carries the -sdk suffix:

from nevo import Nevo

Usage

The library needs to be configured with an API key from the Nevo dashboard.

import asyncio
from nevo import Nevo

client = Nevo(token="nvo_live_...")

@client.on_event()
async def handle(event):
    print(event.id, event.type, event.prompt_ready)

asyncio.run(client.run())

For scripts, there's a blocking convenience:

client.run_sync()

Events

Every event exposes the following fields:

Field Type
id str stable across replays
type str webhook.received or email.received
origin str live or replay
created_at datetime
channel Channel the channel that received this event
data dict the raw source payload
webhook WebhookData | None set when type == "webhook.received"
email EmailData | None set when type == "email.received"
prompt_ready str text rendering of the event

Branch on event.type:

@client.on_event()
async def handle(event):
    if event.type == "email.received":
        print(event.email.from_, event.email.subject)
    elif event.type == "webhook.received":
        print(event.webhook.method, event.webhook.path)

Configuration

client = Nevo(
    token="nvo_live_...",
    url="wss://api.nevo.sh/v1/stream",
    handler_timeout=30.0,
    reconnect_max_backoff=30.0,
    logger=None,
)
Option Default Description
token API key from the Nevo dashboard
url wss://api.nevo.sh/v1/stream Override for self-hosted Nevo
handler_timeout 30.0 Seconds before a handler is considered stuck
reconnect_max_backoff 30.0 Cap on exponential reconnect delay
logger logging.getLogger("nevo") Your own logging.Logger

Handler behavior

Handlers must be declared with async def. Exactly one handler per client — branch on event.type inside it.

  • If the handler returns, the event is considered handled.
  • If the handler raises, the exception is logged and the stream continues.
  • If the handler doesn't return before handler_timeout, it's logged as a timeout and the stream continues.

Events are not re-delivered to the SDK on handler failure. Replay them from the dashboard when you need to.

Reconnects

The client reconnects automatically using exponential backoff with jitter, capped at reconnect_max_backoff. If the server rejects the API key with a 401, the SDK raises AuthError and does not retry.

Logging

The SDK logs under the nevo logger. Enable debug output:

import logging
logging.getLogger("nevo").setLevel(logging.DEBUG)

Errors

All exceptions inherit from nevo.NevoError.

Exception Raised when
AuthError The API key is rejected by the server.
ConnectionError The client cannot connect after exhausting retries.
NevoError Base class.
from nevo import Nevo, AuthError

try:
    asyncio.run(client.run())
except AuthError:
    # Fix the key and restart.
    ...

Self-hosting

Point url at your instance:

Nevo(token="...", url="wss://events.internal/v1/stream")

Support

License

MIT

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

nevo_sdk-0.1.0.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

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

nevo_sdk-0.1.0-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file nevo_sdk-0.1.0.tar.gz.

File metadata

  • Download URL: nevo_sdk-0.1.0.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for nevo_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 aa0678efe51f5c53fb928d71e0a22290c571b92bc0752b52cc77416fae6574ef
MD5 c94d0d37d41e45196bfac5842e10178f
BLAKE2b-256 d9bb2256bd22750d600f0744498894bd8b5ab42366e80716c02b34d3447cc032

See more details on using hashes here.

File details

Details for the file nevo_sdk-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nevo_sdk-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for nevo_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 96b3799f098253e4a5c74af5e3e83fee134efad05d24f4fcf67284b7f187b39f
MD5 d59675d0de38d556eef828ed5cb46d6b
BLAKE2b-256 d5abecff0d1d5de246f019e0d9e5b5aaf5b78ebdd5bbcd94a12be1676a601694

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