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.2.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.2-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nevo_sdk-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 72481d03f5c8890080bb06e5cc80b2365e81cb35ec7d163160cbc0c4b0dfa9f3
MD5 3557e9cd1d9276b86f6d056630c6422a
BLAKE2b-256 a89c5a8b6df37839c79a60bbca93f0245e016b5b9ca52d6c064295cb79cacd61

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nevo_sdk-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 37eeaa7289b17bc6db2f40adc903db7d91fda777a7f6e35a599f06743b4b997a
MD5 8df2818b9430fe3e204f5a47cff0b425
BLAKE2b-256 3df85859abbbc3fe72c3bb5d73ae4f05a5a46abb4acd410f2d85d042a441f6c6

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