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
- Developer program — the deal: no fee, your licence, the compatibility promise.
- Your first detector — scaffold, run against a stack, list in the catalog.
- SDK reference — every public name, by task.
- Platform client, app surfaces, credentials, event contracts.
- Example apps — thirteen first-party apps built on this SDK.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0330d7fda971cb357e01d370435e98baf3f90faf0dd09952a1e2fb8e471bdcbb
|
|
| MD5 |
dfe7c9bbd91581de4e8cefe8db70a237
|
|
| BLAKE2b-256 |
509910d2436a8b97ff26a130e636e543b4066e735190c5fa3697cb1f9a5ebbe9
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opennvr_app_sdk-0.4.0.tar.gz -
Subject digest:
0330d7fda971cb357e01d370435e98baf3f90faf0dd09952a1e2fb8e471bdcbb - Sigstore transparency entry: 2727684565
- Sigstore integration time:
-
Permalink:
open-nvr/open-nvr@95cd2bda3f0ba6d93757bc93ec877113b107d5d4 -
Branch / Tag:
refs/tags/sdk-v0.4.0 - Owner: https://github.com/open-nvr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk.yml@95cd2bda3f0ba6d93757bc93ec877113b107d5d4 -
Trigger Event:
push
-
Statement type:
File details
Details for the file opennvr_app_sdk-0.4.0-py3-none-any.whl.
File metadata
- Download URL: opennvr_app_sdk-0.4.0-py3-none-any.whl
- Upload date:
- Size: 89.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0ecf0afea71ca45a95328de715db10304ad23eacdf7cb8f2b3a94008ccd65619
|
|
| MD5 |
1cb86f56d880600eabe6e83e6be5af29
|
|
| BLAKE2b-256 |
e6c9c06c6e326fb743e36b8ae3019fde30c4f6657b5e7c27bf27aade3c3d1960
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
opennvr_app_sdk-0.4.0-py3-none-any.whl -
Subject digest:
0ecf0afea71ca45a95328de715db10304ad23eacdf7cb8f2b3a94008ccd65619 - Sigstore transparency entry: 2727685233
- Sigstore integration time:
-
Permalink:
open-nvr/open-nvr@95cd2bda3f0ba6d93757bc93ec877113b107d5d4 -
Branch / Tag:
refs/tags/sdk-v0.4.0 - Owner: https://github.com/open-nvr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-sdk.yml@95cd2bda3f0ba6d93757bc93ec877113b107d5d4 -
Trigger Event:
push
-
Statement type: