Skip to main content

Viewtron Python SDK

Python SDK for Viewtron IP camera API. Parse inbound alarm events and control cameras programmatically.

Viewtron IP cameras run AI detection on-camera (license plate recognition, face detection, human/vehicle detection) and send HTTP POST events to your server. This SDK parses those events and provides an API client for camera control.

Install

pip install viewtron

Inbound Events — Parse Camera Alarm Data

Viewtron cameras and NVRs send XML alarm events via HTTP POST. This SDK parses them into Python objects.

from viewtron import ViewtronServer

def on_event(event, client_ip):
    if event.category == "lpr":
        print(event.get_plate_number())       # "ABC1234"
        print(event.get_plate_group())        # "whiteList" or NVR group name

        # Images as decoded JPEG bytes — ready for saving, MQTT, notifications
        overview = event.get_source_image_bytes()   # full scene
        plate_crop = event.get_target_image_bytes() # plate closeup

server = ViewtronServer(port=5050, on_event=on_event)
server.serve_forever()

Supported Event Types

Source Class Detection
IPC v1.x LPR License plate recognition with plate groups
IPC v1.x FaceDetection Face detection with crop image
IPC v1.x IntrusionDetection Perimeter intrusion (person/vehicle)
IPC v1.x IntrusionEntry Zone entry
IPC v1.x IntrusionExit Zone exit
IPC v1.x LoiteringDetection Loitering
IPC v1.x VideoMetadata Continuous object detection
NVR v2.0 VehicleLPR LPR with vehicle brand/color/type and plate groups
NVR v2.0 FaceDetectionV2 Face detection with age/sex/glasses/mask
NVR v2.0 RegionIntrusion Perimeter intrusion
NVR v2.0 LineCrossing Tripwire line crossing
NVR v2.0 TargetCountingByLine People/vehicle counting by line
NVR v2.0 TargetCountingByArea People/vehicle counting by area
NVR v2.0 VideoMetadataV2 Continuous object detection

Version detection is automatic — IPC v1.x and NVR v2.0 use different XML structures but the SDK handles both.

Outbound API — Control the Camera

from viewtron import ViewtronCamera

camera = ViewtronCamera("192.168.0.20", "admin", "password")

# Device info
info = camera.get_device_info()
print(info["model"])  # "LPR-IP4"

# Manage the license plate database
plates = camera.get_plates()
camera.add_plate("ABC1234")
camera.modify_plate("ABC1234", owner="Mike", telephone="555-1234")
camera.delete_plate("ABC1234")

# Or use as context manager
with ViewtronCamera("192.168.0.20", "admin", "password") as cam:
    plates = cam.get_plates()

Projects Using This SDK

Documentation

Products

Author

Mike Haldas — CCTV Camera Pros mike@cctvcamerapros.net

Metadata

Release files for viewtron 1.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for viewtron 1.3.1
File Size Uploaded
viewtron-1.3.1.tar.gz 21.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for viewtron 1.3.1
File Interpreter ABI Platform
viewtron-1.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 39.5 kB

Release files / viewtron-1.3.1.tar.gz

Download URL viewtron-1.3.1.tar.gz
Size 21.1 kB
Tags Source
SHA-256 checksum
How to use checksums
226d94d0b054192900a15a9ea919e0285c067e81259d7c9ffc2a9757cbb0a629
BLAKE2b-256 checksum
How to use checksums
5712e3f0edd4a81d6a64584e25a0435b1fbdc0dfb07ae9c6a3b126fe0e640f0d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Release files / viewtron-1.3.1-py3-none-any.whl

Download URL viewtron-1.3.1-py3-none-any.whl
Size 18.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c5d0fe2ff94c5b3c49189c6fdbc2c98fb182d37337c033f80095de0d8fe87a3b
BLAKE2b-256 checksum
How to use checksums
8cba994dcebd0bff70a6c7373c5a165845c5b21be0b28693eb0c374bd22c26c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 4, 2026.

Transparency log

Release history Release notifications | RSS feed

1.4.1

2 release files

1.4.0

2 release files

This release

1.3.1 This release

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.0

2 release 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