Python SDK for TP-Link VIGI NVR OpenAPI.
Project description
TP-Link VIGI SDK
Python SDK for the documented, read-only portions of the TP-Link VIGI NVR OpenAPI.
Requirements and Installation
- Python 3.10 or later.
Install the project in an isolated environment from the repository root:
python -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install -e ".[dev]"
Quickstart
Set the NVR connection variables in your shell. .env is not loaded
automatically by the SDK, tests, or examples.
$env:VIGI_HOST = "nvr.example.invalid"
$env:VIGI_PORT = "20443"
$env:VIGI_USERNAME = "admin"
$env:VIGI_PASSWORD = "<your-nvr-password>"
$env:VIGI_VERIFY_SSL = "true"
Then authenticate and list NVR-managed devices:
import os
from vigi import AuthConfig, VigiClient
client = VigiClient(
AuthConfig(
host=os.environ["VIGI_HOST"],
port=int(os.getenv("VIGI_PORT", "20443")),
username=os.environ["VIGI_USERNAME"],
password=os.environ["VIGI_PASSWORD"],
verify_tls=os.getenv("VIGI_VERIFY_SSL", "true").lower() not in {"0", "false", "no"},
)
)
client.login()
devices = client.devices.list_added_devices()
for device in devices.devices:
print(device.channel_id, device.name, device.alias, device.online.value)
client.login() and service calls contact the configured NVR. Constructing a
client or importing vigi does not make a network request.
Read-only workflows and examples
The detailed usage guide covers authentication, device inventory, recording-day and recording-result searches, explicit error handling, and RTSP replay URL construction.
Examples read environment variables only when their main() function runs.
They do not load .env, print passwords or tokens, save files, or open RTSP
connections.
Supported scope
Implemented read-only SDK support includes:
- Documented NVR authentication.
- NVR-managed device inventory with
client.devices.list_added_devices(). - Recording-day, free-search-process, and recording-result queries.
client.stream.build_replay_url(...)for documented RTSP replay URLs.
The RTSP helper only builds a URL. It does not open RTSP, perform a Digest
handshake, download video, or save video files. Replay stream 1 and explicit
UTC YYYYMMDDtHHMMSSz times are required.
Unsupported or deferred:
- Snapshot: unsupported because the current official NVR and IPC OpenAPI documents do not define a snapshot or capture API.
- Export/download, RTSP playback, video saving, ffmpeg, and image processing.
- CLI: deferred to a separate phase.
- Public standalone IPC/camera APIs.
Tests
Run the default unit and smoke-test suite:
python -m pytest
Real-device integration tests are opt-in. Export the required VIGI_*
variables in the shell, then run the relevant test explicitly, for example:
python -m pytest tests/test_integration_records.py -v
See docs/05-test-strategy.md and .env.example for the supported local configuration variables.
Documentation
Start with:
License
This project is licensed under the MIT License.
Disclaimer
This project is not affiliated with, endorsed by, or sponsored by TP-Link. TP-Link and VIGI are trademarks of their respective owners. Use this SDK only with devices and credentials you are authorized to access.
Project details
Release history Release notifications | RSS feed
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 tp_link_vigi_sdk-0.1.0.tar.gz.
File metadata
- Download URL: tp_link_vigi_sdk-0.1.0.tar.gz
- Upload date:
- Size: 27.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a462c3b5362fdacd21099c4516327bdecd40f849b8b54922dc43780844111cb2
|
|
| MD5 |
514150edd1a6c9bdd00226f608ddd951
|
|
| BLAKE2b-256 |
eed59a7316d158751bee971f6f06ea63be33a49780724664ff2d7e865a764f15
|
File details
Details for the file tp_link_vigi_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tp_link_vigi_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
88ffe8276635059b87b03bf05a5625d509d7e695da037563564af293e4ebd9d7
|
|
| MD5 |
67c0626d6bc065a14b2b7cb8228010b8
|
|
| BLAKE2b-256 |
d1efec2b37c751810322c55cf57ea42c2d18da99769fdca2cd18180f96d782a3
|