Skip to main content

python-vivotek

Verify Maintainability

A Python library for Vivotek IP cameras.

Getting Started

Install

This library currently supports Python 3.6 and up.

For Python 3.5 use v0.4.0

pip3 install libpyvivotek

# Or for only the current user
pip3 install --user libpyvivotek

Usage

from libpyvivotek import VivotekCamera

cam = VivotekCamera(host='192.168.1.123', port=443, usr='user', pwd='passw0rd',
                    digest_auth=True, ssl=True, verify_ssl=True, sec_lvl='admin')
print("Camera model is %s" % cam.model_name)
# Camera model is IB8369A

Authentication

Some camera models use digest by default so if you know the credentials are correct but are still seeing "Unauthorized" then try with digest_auth=True.

Security Level

Four security levels are currently supported:

  • anonymous
  • viewer
  • operator
  • admin

Using the anonymous security level does not require a user or password. The operator or admin security level is required to set parameters.

Load password from Keyring

We can use Python Keyring to load the password rather than from a string.

# Install the package
pip install --user keyring

# Set the password using the command-line interface.
python -m keyring set camera user passw0rd
import keyring
from libpyvivotek import VivotekCamera

cam = VivotekCamera(host='192.168.1.123', port=443, usr='user',
                    pwd=keyring.get_password('camera', 'user'), sec_lvl='admin')
print("Camera model is %s" % cam.model_name)
# Camera model is IB8369A

View a snapshot image

We can optionally specify the image quality to snapshot() from 1 to 5 with a default of 3.

from libpyvivotek import VivotekCamera
from PIL import Image
from io import BytesIO
import keyring

cam = VivotekCamera(host='192.168.1.123', port=443, usr='user',
                    pwd=keyring.get_password('camera', 'user'), sec_lvl='admin')

snapshot = Image.open(BytesIO(cam.snapshot(quality=3)))

snapshot.show()

Getting parameters

cam.get_param('capability_api_httpversion')
# "0311b_1"

cam.get_param('capability_naudioin')
# "0"

cam.get_param('capability_protocol_https')
# "1"

cam.get_param('event_i0_enable')
# "1"

cam.get_param('motion_c0_enable')
# "1"

Setting parameters

cam.set_param('event_i0_enable', 1)
# "1"

cam.set_param('event_i0_enable', 0)
# "0"

Developing

Install dependencies and run the test suite for a sanity check.

pip install --user -r requirements_test.txt
pip install --user pytest
pytest

Metadata

Release files for libpyvivotek 0.6.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 libpyvivotek 0.6.1
File Size Uploaded
libpyvivotek-0.6.1.tar.gz 16.9 kB Details

Built distribution (wheel)

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

Total release size: 33.9 kB

Release files / libpyvivotek-0.6.1.tar.gz

Download URL libpyvivotek-0.6.1.tar.gz
Size 16.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9f73bc05919119b7d88ac9354782fbb0003e52db6dfcca8f977e3445683af602
BLAKE2b-256 checksum
How to use checksums
888f1ea65a6e1e9dd2f74c6c5914ebdddfd37fcf5f198fd1646f6b5e5e8c56cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release files / libpyvivotek-0.6.1-py3-none-any.whl

Download URL libpyvivotek-0.6.1-py3-none-any.whl
Size 17.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2e14bd6cf13091d59cbf0da1e9880a13905ba14df68a663ae3ac2a7cff1550f9
BLAKE2b-256 checksum
How to use checksums
9bdc52b590b8b516dea10fe40c517343392781c1f5b38c414cd3c8e938c7f7e4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.5

Release history Release notifications | RSS feed

This release

0.6.1 This release

2 release files

0.6.0

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1

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