python-vivotek
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)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| libpyvivotek-0.6.1.tar.gz | 16.9 kB | Without provenance | Details for libpyvivotek-0.6.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| libpyvivotek-0.6.1-py3-none-any.whl | Python 3 | none | any | Details for libpyvivotek-0.6.1-py3-none-any.whl |
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
|
Security for libpyvivotek 0.6.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.