Skip to main content

opennvr-app-sdk

The SDK for building vision apps on OpenNVR, the self-hosted AI video platform. Cameras, Tier-0 detections, pluggable inference, an event bus, recordings, an operator alert inbox, users and per-camera permissions, and a catalog every deployment opens — all already running. You write the rule, the model or the workflow; this package is the only import you need.

Apache-2.0 — ship your app under any licence, closed included.

pip install opennvr-app-sdk

A detector in one method

from opennvr_app_sdk import Alert, AppManifest, Detector, Param, app

class Loitering(Detector):
    manifest = AppManifest(
        id="loitering", name="Loitering", version="1.0.0", category="perimeter",
        requires_tasks=["object_detection"],
        params=[Param("dwell_s", float, default=30.0)],
    )

    def setup(self):
        self.present = self.keyed_state(ttl=10.0)   # forgets a camera 10 s after the last person

    def on_detections(self, camera_id, detections, event):
        people = [d for d in detections if d.get("label") == "person"]
        if not people:
            return
        rec = self.present.touch(camera_id)
        if rec.age >= self.cfg.dwell_s and not rec.alerted:
            rec.alerted = True
            yield Alert(title="Loitering", description=f"{len(people)} person(s) for {rec.age:.0f}s",
                        camera_id=camera_id, severity="medium")

if __name__ == "__main__":
    raise SystemExit(app(Loitering).run())

That app subscribes to the platform's detections, serves the registry contract (/health, /state, /manifest, config form, actions), registers itself in the App Catalog, is issued its own credential, and fires alerts that reach the operator inbox — none of which you wrote.

The platform, from an app

from opennvr_app_sdk import OpenNVR            # or opennvr_app_sdk.aio.AsyncOpenNVR

nvr = OpenNVR()                                 # OPENNVR_URL + the app's key
for cam in nvr.cameras():                       # only cameras assigned to this app
    jpeg = nvr.snapshot(cam)
    det = nvr.ai.infer("yolov8", jpeg, task="object_detection", camera_id=cam.handle)
nvr.state.set("last_seen", {"cam1": 12.5})      # durable, survives restarts
clips = nvr.recordings("cam1").list(start="2026-09-05T00:00:00Z")
mine = nvr.alerts.inbox(unacked=True)

Where to go next

Compatibility: the app-registry contract is versioned (api_version) and tested in the OpenNVR repository on every change; min_sdk_version only moves when an older SDK would misbehave. Issues tagged sdk at open-nvr/open-nvr.

Download files

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

Source Distribution

opennvr_app_sdk-0.4.0.tar.gz (103.0 kB view details)

Uploaded Source

Built Distribution

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

opennvr_app_sdk-0.4.0-py3-none-any.whl (89.0 kB view details)

Uploaded Python 3

File details

Details for the file opennvr_app_sdk-0.4.0.tar.gz.

File metadata

  • Download URL: opennvr_app_sdk-0.4.0.tar.gz
  • Upload date:
  • Size: 103.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for opennvr_app_sdk-0.4.0.tar.gz
Algorithm Hash digest
SHA256 0330d7fda971cb357e01d370435e98baf3f90faf0dd09952a1e2fb8e471bdcbb
MD5 dfe7c9bbd91581de4e8cefe8db70a237
BLAKE2b-256 509910d2436a8b97ff26a130e636e543b4066e735190c5fa3697cb1f9a5ebbe9

See more details on using hashes here.

Provenance

The following attestation bundles were made for opennvr_app_sdk-0.4.0.tar.gz:

Publisher: publish-sdk.yml on open-nvr/open-nvr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file opennvr_app_sdk-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for opennvr_app_sdk-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0ecf0afea71ca45a95328de715db10304ad23eacdf7cb8f2b3a94008ccd65619
MD5 1cb86f56d880600eabe6e83e6be5af29
BLAKE2b-256 e6c9c06c6e326fb743e36b8ae3019fde30c4f6657b5e7c27bf27aade3c3d1960

See more details on using hashes here.

Provenance

The following attestation bundles were made for opennvr_app_sdk-0.4.0-py3-none-any.whl:

Publisher: publish-sdk.yml on open-nvr/open-nvr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page