Skip to main content

OpenDahua

PyPI - Version GitHub License

Python SDK for interacting with Dahua NVRs (Network Video Recorders) over their proprietary peer-to-peer protocol.

Installation

You can install OpenDahua with your favorite python package manager!

pip install opendahua

or

uv add opendahua

Usage

[!WARNING] Within the async with DahuaNVR(xxx) as nvr: block you should use async for all IO operations. The peer-to-peer connection might die if you don't do this.

import asyncio
from datetime import datetime, timedelta

from opendahua import DahuaNVR


async def main() -> None:
    async with DahuaNVR("SERIAL_NUMBER_HERE", "USERNAME_HERE", "PASSWORD_HERE") as nvr:
        all_video = await nvr.get_videos(
            channel=1,
            time_start=datetime.now() - timedelta(days=1),
        )
        
        for video in all_video:
            path = await nvr.download_video(video, "videos/")
            
            # Example: videos/ExampleNVR_ch1_20260601135935_20260601140002.dav
            print(f"Video path: {path}")
        
if __name__ == "__main__":
    asyncio.run(main())

Special thanks to

  • khoanguyen-3fc/dh-p2p: The reverse engineering work and proof-of-concept that make this project possible.

Metadata

Release files for OpenDahua 1.0.8

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

Source distribution (sdist)

Source distribution for OpenDahua 1.0.8
File Size Uploaded
opendahua-1.0.8.tar.gz 28.1 kB Details

Built distribution (wheel)

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

Total release size: 93.8 kB

Release files / opendahua-1.0.8.tar.gz

Download URL opendahua-1.0.8.tar.gz
Size 28.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6e921bbf571f544c3a21afdf1728a0b99cc25da00dd24c2a20f573b947bf4ad0
BLAKE2b-256 checksum
How to use checksums
547f375d836231b3dbec9a6924ee60189f647c38308fcb7a944cda5d074629f3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / opendahua-1.0.8-py3-none-any.whl

Download URL opendahua-1.0.8-py3-none-any.whl
Size 65.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c9b7f8b9bd59fcb64764f094231b0596c141b44166f8095bb34e0f101ec4241c
BLAKE2b-256 checksum
How to use checksums
726c7cace04ad24395f301ae13cd4aee53a7eccf4e3f84ce03c23730851fa19c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.15 {"installer":{"name":"uv","version":"0.11.15","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

1.0.8 This release

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

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