New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

onvif-python

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

onvif-python - pypi Package Compare versions

Comparing version
0.2.4
to
0.2.5
+41
-24
onvif_python.egg-info/PKG-INFO
Metadata-Version: 2.4
Name: onvif-python
Version: 0.2.4
Version: 0.2.5
Summary: A modern Python library for ONVIF-compliant devices

@@ -47,9 +47,9 @@ Author-email: Nirsimetri Technologies® <open@nirsimetri.com>

<div align="center">
<img alt="Codacy grade" src="https://img.shields.io/codacy/grade/bff08a94e4d447b690cea49c6594826d?label=Code%20Quality&logo=codacy" href="https://app.codacy.com/gh/nirsimetri/onvif-python/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade">
<img alt="Ask DeepWiki" src="https://deepwiki.com/badge.svg" href="https://deepwiki.com/nirsimetri/onvif-python">
<img alt="PyPI Version" src="https://img.shields.io/badge/PyPI-0.2.4-orange?logo=archive&color=yellow" href="https://pypi.org/project/onvif-python/">
<img alt="Pepy Total Downloads" src="https://img.shields.io/pepy/dt/onvif-python?label=Downloads&color=red" href="https://pepy.tech/projects/onvif-python">
<a href="https://app.codacy.com/gh/nirsimetri/onvif-python/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img alt="Codacy grade" src="https://img.shields.io/codacy/grade/bff08a94e4d447b690cea49c6594826d?label=Code%20Quality&logo=codacy"></a>
<a href="https://deepwiki.com/nirsimetri/onvif-python"><img alt="Ask DeepWiki" src="https://deepwiki.com/badge.svg"></a>
<a href="https://pypi.org/project/onvif-python/"><img alt="PyPI Version" src="https://img.shields.io/badge/PyPI-0.2.5-orange?logo=archive&color=yellow"></a>
<a href="https://pepy.tech/projects/onvif-python"><img alt="Pepy Total Downloads" src="https://img.shields.io/pepy/dt/onvif-python?label=Downloads&color=red"></a>
<br>
<img alt="Build" src="https://github.com/nirsimetri/onvif-python/actions/workflows/python-app.yml/badge.svg?branch=main" href="https://github.com/nirsimetri/onvif-python/actions/workflows/python-app.yml">
<img alt="Upload Python Package" src="https://github.com/nirsimetri/onvif-python/actions/workflows/python-publish.yml/badge.svg" href="https://github.com/nirsimetri/onvif-python/actions/workflows/python-publish.yml">
<a href="https://github.com/nirsimetri/onvif-python/actions/workflows/python-app.yml"><img alt="Build" src="https://github.com/nirsimetri/onvif-python/actions/workflows/python-app.yml/badge.svg?branch=main"></a>
<a href="https://github.com/nirsimetri/onvif-python/actions/workflows/python-publish.yml"><img alt="Upload Python Package" src="https://github.com/nirsimetri/onvif-python/actions/workflows/python-publish.yml/badge.svg"></a>
</div>

@@ -68,12 +68,18 @@

This library simplifies that process by wrapping SOAP communication into a clean, Pythonic API. You no longer need to handle low-level XML parsing, namespaces, or security tokens manually — the library takes care of it, letting you focus on building functionality.
This library simplifies that process by wrapping SOAP communication into a clean, Pythonic API. You no longer need to handle low-level XML parsing, namespaces, or security tokens manually — the library takes care of it, letting you focus on building functionality.
## Key Features
- Full implementation of ONVIF core services and profiles
- Support for device discovery, media streaming, PTZ control, event management, and more
- Pythonic abstraction over SOAP requests and responses (no need to handcraft XML)
- Extensible architecture for custom ONVIF extensions
- Compatible with multiple ONVIF specification versions
- Example scripts and tests included
## Library Philosophy
> [!NOTE]
> This library will be continuously updated as ONVIF versions are updated. It uses a built-in WSDL that will always follow changes to the [ONVIF WSDL Specifications](https://github.com/onvif/specs). You can also use your own ONVIF WSDL file by adding the `wsdl_dir` argument; see [ONVIFClient Parameters](#onvifclient-parameters).
- **WYSIWYG (What You See is What You Get)**: Every ONVIF operation in the library mirrors the official ONVIF specification exactly. Method names, parameter structures, and response formats follow ONVIF standards without abstraction layers or renamed interfaces. What you see in the ONVIF documentation is exactly what you get in Python.
- **Device Variety Interoperability**: Built to handle the real-world diversity of ONVIF implementations across manufacturers. The library gracefully handles missing features, optional operations, and vendor-specific behaviors through comprehensive error handling and fallback mechanisms. Whether you're working with high-end enterprise cameras or budget IP cameras, the library adapts.
- **Official Specifications Accuracy**: All service implementations are generated and validated against official `ONVIF WSDL Specifications`. The library includes comprehensive test suites that verify compliance with ONVIF standards, ensuring that method signatures, parameter types, and behavior match the official specifications precisely.
- **Modern Python Approach**: Designed for excellent IDE support with full type hints, auto-completion, and immediate error detection. You'll get `TypeError` exceptions upfront when accessing ONVIF operations with wrong arguments, instead of cryptic `SOAP faults` later. Clean, Pythonic API that feels natural to Python developers while maintaining ONVIF compatibility.
- **Minimal Dependencies**: Only depends on essential, well-maintained libraries (`zeep` for SOAP, `requests` for HTTP). No bloated framework dependencies or custom XML parsers. The library stays lightweight while providing full ONVIF functionality, making it easy to integrate into any project without dependency conflicts.
## Who Is It For?

@@ -356,7 +362,8 @@ - **Individual developers** exploring ONVIF or building hobby projects

```bash
usage: onvif [-h] [--host HOST] [--port PORT] [--username USERNAME] [--password PASSWORD] [--discover] [--filter FILTER] [--search SEARCH] [--page PAGE] [--per-page PER_PAGE] [--timeout TIMEOUT] [--https]
[--no-verify] [--no-patch] [--interactive] [--debug] [--wsdl WSDL] [--cache {all,db,mem,none}] [--health-check-interval HEALTH_CHECK_INTERVAL] [--version]
usage: onvif [-h] [--host HOST] [--port PORT] [--username USERNAME] [--password PASSWORD] [--discover] [--filter FILTER] [--search SEARCH] [--page PAGE]
[--per-page PER_PAGE] [--timeout TIMEOUT] [--https] [--no-verify] [--no-patch] [--interactive] [--debug] [--wsdl WSDL]
[--cache {all,db,mem,none}] [--health-check-interval HEALTH_CHECK_INTERVAL] [--output OUTPUT] [--version]
[service] [method] [params ...]
ONVIF Terminal Client — v0.2.4
ONVIF Terminal Client — v0.2.5
https://github.com/nirsimetri/onvif-python

@@ -395,2 +402,5 @@

Health check interval in seconds for interactive mode (default: 10)
--output OUTPUT, -o OUTPUT
Save command output to file. Supports .json, .xml extensions for format detection, or plain text. XML format automatically enables
debug mode for SOAP capture.
--version, -v Show ONVIF CLI version and exit

@@ -416,4 +426,9 @@

onvif devicemgmt GetCapabilities Category=All --host 192.168.1.17 --port 8000 --username admin --password admin123
onvif ptz ContinuousMove ProfileToken=Profile_1 Velocity={"PanTilt": {"x": -0.1, "y": 0}} --host 192.168.1.17 --port 8000 --username admin --password admin123
onvif ptz ContinuousMove ProfileToken=Profile_1 Velocity={'PanTilt': {'x': -0.1, 'y': 0}} -H 192.168.1.17 -P 8000 -u admin -p admin123
# Save output to file
onvif devicemgmt GetDeviceInformation --host 192.168.1.17 --port 8000 --username admin --password admin123 --output device_info.json
onvif media GetProfiles --host 192.168.1.17 --port 8000 --username admin --password admin123 --output profiles.xml
onvif ptz GetConfigurations --host 192.168.1.17 --port 8000 --username admin --password admin123 --output ptz_config.txt --debug
# Interactive mode

@@ -436,3 +451,3 @@ onvif --host 192.168.1.17 --port 8000 --username admin --password admin123 --interactive

```bash
ONVIF Interactive Shell — v0.2.4
ONVIF Interactive Shell — v0.2.5
https://github.com/nirsimetri/onvif-python

@@ -645,3 +660,7 @@

# Move a PTZ camera
onvif ptz ContinuousMove ProfileToken=Profile_1 Velocity='{"PanTilt": {"x": 0.1}}' -H 192.168.1.17 -P 8000 -u admin -p admin123
onvif ptz ContinuousMove ProfileToken=Profile_1 Velocity='{"PanTilt": {"x": 0.1, "y": 0}}' -H 192.168.1.17 -P 8000 -u admin -p admin123
# Save output to file
onvif devicemgmt GetDeviceInformation --host 192.168.1.17 --port 8000 --username admin --password admin123 --output device_info.json
onvif media GetProfiles -H 192.168.1.17 -P 8000 -u admin -p admin123 -o profiles.xml
```

@@ -1162,4 +1181,2 @@

- [ ] Add community-contributed device configuration templates.
- [ ] Implement missing or partial ONVIF services.
- [ ] Add function to expose ONVIF devices (for debugging purposes by the community).

@@ -1169,3 +1186,3 @@ ## Related Projects

- [onvif-products-directory](https://github.com/nirsimetri/onvif-products-directory):
This project is a comprehensive ONVIF data aggregation and management suite, designed to help developers explore, analyze, and process ONVIF-compliant product information from hundreds of manufacturers worldwide. It provides a unified structure for device, client, and company data, making it easier to perform research, build integrations, and generate statistics for ONVIF ecosystem analysis.
This project is a comprehensive ONVIF data aggregation and management suite, designed to help developers explore, analyze, and process ONVIF-compliant product information from hundreds of manufacturers worldwide.

@@ -1172,0 +1189,0 @@ - (soon) [onvif-rest-server](https://github.com/nirsimetri/onvif-rest-server):

# onvif/__init__.py
from .client import ONVIFClient
from .operator import ONVIFOperator, CacheMode
from .operator import CacheMode
from .utils import (

@@ -17,3 +17,2 @@ ONVIFWSDL,

"ONVIFClient",
"ONVIFOperator",
"CacheMode",

@@ -20,0 +19,0 @@ "ONVIFWSDL",

@@ -197,3 +197,3 @@ # onvif/cli/interactive.py

"/ /_/ / /| / | |/ // // __/ ",
"\\____/_/ |_/ |___/___/_/ v0.2.4",
"\\____/_/ |_/ |___/___/_/ v0.2.5",
" ",

@@ -1404,3 +1404,3 @@ ]

help_text = f"""
{colorize('ONVIF Interactive Shell — v0.2.4', 'cyan')}\n{colorize('https://github.com/nirsimetri/onvif-python', 'white')}
{colorize('ONVIF Interactive Shell — v0.2.5', 'cyan')}\n{colorize('https://github.com/nirsimetri/onvif-python', 'white')}

@@ -1407,0 +1407,0 @@ {colorize('Basic Commands:', 'yellow')}

@@ -10,2 +10,3 @@ # onvif/cli/main.py

import shutil
import json
from datetime import datetime

@@ -25,3 +26,3 @@ from typing import Any, Optional, Tuple

prog="onvif",
description=f"{colorize('ONVIF Terminal Client', 'yellow')} — v0.2.4\nhttps://github.com/nirsimetri/onvif-python",
description=f"{colorize('ONVIF Terminal Client', 'yellow')} — v0.2.5\nhttps://github.com/nirsimetri/onvif-python",
formatter_class=argparse.RawDescriptionHelpFormatter,

@@ -47,4 +48,9 @@ epilog=f"""

{colorize('onvif', 'yellow')} devicemgmt GetCapabilities Category=All --host 192.168.1.17 --port 8000 --username admin --password admin123
{colorize('onvif', 'yellow')} ptz ContinuousMove ProfileToken=Profile_1 Velocity={{"PanTilt": {{"x": -0.1, "y": 0}}}} --host 192.168.1.17 --port 8000 --username admin --password admin123
{colorize('onvif', 'yellow')} ptz ContinuousMove ProfileToken=Profile_1 Velocity={{'PanTilt': {{'x': -0.1, 'y': 0}}}} -H 192.168.1.17 -P 8000 -u admin -p admin123
# Save output to file
{colorize('onvif', 'yellow')} devicemgmt GetDeviceInformation --host 192.168.1.17 --port 8000 --username admin --password admin123 --output device_info.json
{colorize('onvif', 'yellow')} media GetProfiles --host 192.168.1.17 --port 8000 --username admin --password admin123 --output profiles.xml
{colorize('onvif', 'yellow')} ptz GetConfigurations --host 192.168.1.17 --port 8000 --username admin --password admin123 --output ptz_config.txt --debug
# Interactive mode

@@ -145,2 +151,7 @@ {colorize('onvif', 'yellow')} --host 192.168.1.17 --port 8000 --username admin --password admin123 --interactive

)
parser.add_argument(
"--output",
"-o",
help="Save command output to file. Supports .json, .xml extensions for format detection, or plain text. XML format automatically enables debug mode for SOAP capture.",
)

@@ -184,3 +195,3 @@ # Service and method (for direct command execution)

if args.version:
print(colorize("0.2.4", "yellow"))
print(colorize("0.2.5", "yellow"))
sys.exit(0)

@@ -204,2 +215,8 @@

# Validate output argument
if args.output and args.interactive:
parser.error(
f"{colorize('--output', 'white')} cannot be used with {colorize('--interactive', 'white')} mode"
)
# Handle discovery mode

@@ -269,2 +286,7 @@ if args.discover:

# Create ONVIF client
# Auto-enable debug mode if output format is XML
auto_debug = args.debug or (
args.output and args.output.lower().endswith(".xml")
)
client = ONVIFClient(

@@ -280,3 +302,3 @@ host=args.host,

apply_patch=not args.no_patch,
capture_xml=args.debug,
capture_xml=auto_debug,
wsdl_dir=args.wsdl,

@@ -309,4 +331,14 @@ )

result = execute_command(client, args.service, args.method, params_str)
print(str(result))
# Save output to file if specified
if args.output:
# Auto-enable debug mode for XML output
effective_debug = args.debug or args.output.lower().endswith(".xml")
save_output_to_file(result, args.output, effective_debug, client)
print(
f"{colorize('Output saved to:', 'green')} {colorize(args.output, 'white')}"
)
else:
print(str(result))
except KeyboardInterrupt:

@@ -349,2 +381,178 @@ print("\nOperation cancelled by user")

def save_output_to_file(
result: Any, output_path: str, debug_mode: bool, client: ONVIFClient
) -> None:
"""Save command output to file in appropriate format based on file extension.
Args:
result: The ONVIF command result
output_path: Path to output file
debug_mode: Whether debug mode is enabled (for XML capture)
client: ONVIFClient instance (for accessing XML plugin)
"""
try:
# Determine output format based on file extension
_, ext = os.path.splitext(output_path.lower())
if ext == ".json":
# Prepare output data
output_data = {}
# JSON format
output_data["result"] = _serialize_for_json(result)
output_data["timestamp"] = datetime.now().isoformat()
output_data["raw_result"] = str(result) # Add raw string as fallback
# Add XML data if debug mode is enabled and XML plugin is available
if debug_mode and client.xml_plugin:
output_data["debug"] = {
"last_request_xml": client.xml_plugin.last_sent_xml,
"last_response_xml": client.xml_plugin.last_received_xml,
"last_operation": client.xml_plugin.last_operation,
}
with open(output_path, "w", encoding="utf-8") as f:
json.dump(output_data, f, indent=2, ensure_ascii=False)
elif ext == ".xml":
# XML format - prioritize raw SOAP XML over parsed result
if client.xml_plugin and client.xml_plugin.last_received_xml:
# Save the raw SOAP response XML with minimal wrapper
content = f"""<?xml version="1.0" encoding="UTF-8"?>
<!-- ONVIF SOAP Response -->
<!-- Timestamp: {datetime.now().isoformat()} -->
<!-- Operation: {client.xml_plugin.last_operation or 'Unknown'} -->
{client.xml_plugin.last_received_xml}
"""
else:
# Fallback: Simple XML wrapper for the parsed result
content = f"""<?xml version="1.0" encoding="UTF-8"?>
<!-- ONVIF Command Output (Parsed Result) -->
<!-- Timestamp: {datetime.now().isoformat()} -->
<!-- Note: Raw SOAP XML not available. Enable --debug for full SOAP capture. -->
<onvif_result>
<![CDATA[
{str(result)}
]]>
</onvif_result>
"""
with open(output_path, "w", encoding="utf-8") as f:
f.write(content)
else:
# Plain text format (default)
content = "ONVIF Command Output\n"
content += f"Timestamp: {datetime.now().isoformat()}\n"
content += f"{'='*50}\n\n"
content += str(result)
# Add debug information if available
if debug_mode and client.xml_plugin:
content += f"\n\n{'='*50}\n"
content += "DEBUG INFORMATION\n"
content += f"{'='*50}\n"
if client.xml_plugin.last_operation:
content += f"Operation: {client.xml_plugin.last_operation}\n\n"
if client.xml_plugin.last_sent_xml:
content += "SOAP Request:\n"
content += client.xml_plugin.last_sent_xml + "\n\n"
if client.xml_plugin.last_received_xml:
content += "SOAP Response:\n"
content += client.xml_plugin.last_received_xml + "\n"
with open(output_path, "w", encoding="utf-8") as f:
f.write(content)
except Exception as e:
print(f"{colorize('Error saving output:', 'red')} {e}", file=sys.stderr)
# Still print the result to console if file save fails
print(str(result))
def _serialize_for_json(obj: Any) -> Any:
"""Recursively serialize ONVIF objects for JSON output.
Args:
obj: Object to serialize
Returns:
JSON-serializable representation of the object
"""
if obj is None:
return None
elif isinstance(obj, (str, int, float, bool)):
return obj
elif isinstance(obj, datetime):
return obj.isoformat()
elif isinstance(obj, (list, tuple)):
return [_serialize_for_json(item) for item in obj]
elif isinstance(obj, dict):
return {key: _serialize_for_json(value) for key, value in obj.items()}
# Check if this is a Zeep object (has _xsd_type attribute)
elif hasattr(obj, "_xsd_type"):
result = {}
# Try to get all elements from XSD type
if hasattr(obj._xsd_type, "elements"):
for elem_name, elem_obj in obj._xsd_type.elements:
try:
value = getattr(obj, elem_name, None)
if value is not None:
result[elem_name] = _serialize_for_json(value)
except (AttributeError, TypeError):
# Skip elements that can't be accessed or have type issues
pass
# Also try regular attributes
for attr_name in dir(obj):
if not attr_name.startswith("_") and not callable(
getattr(obj, attr_name, None)
):
try:
attr_value = getattr(obj, attr_name)
if attr_value is not None and attr_name not in result:
result[attr_name] = _serialize_for_json(attr_value)
except (AttributeError, TypeError):
# Skip attributes that can't be accessed or have type issues
pass
return result
elif hasattr(obj, "__dict__"):
# Handle regular objects with attributes
result = {}
for key, value in obj.__dict__.items():
if not key.startswith("_"): # Skip private attributes
result[key] = _serialize_for_json(value)
# If result is empty, try to get attributes using dir()
if not result:
for attr_name in dir(obj):
if not attr_name.startswith("_") and not callable(
getattr(obj, attr_name, None)
):
try:
attr_value = getattr(obj, attr_name)
if attr_value is not None:
result[attr_name] = _serialize_for_json(attr_value)
except (AttributeError, TypeError):
# Skip attributes that can't be accessed or have type issues
pass
return result
elif hasattr(obj, "_value_1"):
# Handle zeep objects with special structure
return _serialize_for_json(obj._value_1)
else:
# Try to convert to dict using vars() if available
try:
obj_dict = vars(obj)
return _serialize_for_json(obj_dict)
except TypeError:
# Fallback to string representation
return str(obj)
def discover_devices(

@@ -351,0 +559,0 @@ timeout: int = 4, prefer_https: bool = False, filter_term: Optional[str] = None

+41
-24
Metadata-Version: 2.4
Name: onvif-python
Version: 0.2.4
Version: 0.2.5
Summary: A modern Python library for ONVIF-compliant devices

@@ -47,9 +47,9 @@ Author-email: Nirsimetri Technologies® <open@nirsimetri.com>

<div align="center">
<img alt="Codacy grade" src="https://img.shields.io/codacy/grade/bff08a94e4d447b690cea49c6594826d?label=Code%20Quality&logo=codacy" href="https://app.codacy.com/gh/nirsimetri/onvif-python/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade">
<img alt="Ask DeepWiki" src="https://deepwiki.com/badge.svg" href="https://deepwiki.com/nirsimetri/onvif-python">
<img alt="PyPI Version" src="https://img.shields.io/badge/PyPI-0.2.4-orange?logo=archive&color=yellow" href="https://pypi.org/project/onvif-python/">
<img alt="Pepy Total Downloads" src="https://img.shields.io/pepy/dt/onvif-python?label=Downloads&color=red" href="https://pepy.tech/projects/onvif-python">
<a href="https://app.codacy.com/gh/nirsimetri/onvif-python/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img alt="Codacy grade" src="https://img.shields.io/codacy/grade/bff08a94e4d447b690cea49c6594826d?label=Code%20Quality&logo=codacy"></a>
<a href="https://deepwiki.com/nirsimetri/onvif-python"><img alt="Ask DeepWiki" src="https://deepwiki.com/badge.svg"></a>
<a href="https://pypi.org/project/onvif-python/"><img alt="PyPI Version" src="https://img.shields.io/badge/PyPI-0.2.5-orange?logo=archive&color=yellow"></a>
<a href="https://pepy.tech/projects/onvif-python"><img alt="Pepy Total Downloads" src="https://img.shields.io/pepy/dt/onvif-python?label=Downloads&color=red"></a>
<br>
<img alt="Build" src="https://github.com/nirsimetri/onvif-python/actions/workflows/python-app.yml/badge.svg?branch=main" href="https://github.com/nirsimetri/onvif-python/actions/workflows/python-app.yml">
<img alt="Upload Python Package" src="https://github.com/nirsimetri/onvif-python/actions/workflows/python-publish.yml/badge.svg" href="https://github.com/nirsimetri/onvif-python/actions/workflows/python-publish.yml">
<a href="https://github.com/nirsimetri/onvif-python/actions/workflows/python-app.yml"><img alt="Build" src="https://github.com/nirsimetri/onvif-python/actions/workflows/python-app.yml/badge.svg?branch=main"></a>
<a href="https://github.com/nirsimetri/onvif-python/actions/workflows/python-publish.yml"><img alt="Upload Python Package" src="https://github.com/nirsimetri/onvif-python/actions/workflows/python-publish.yml/badge.svg"></a>
</div>

@@ -68,12 +68,18 @@

This library simplifies that process by wrapping SOAP communication into a clean, Pythonic API. You no longer need to handle low-level XML parsing, namespaces, or security tokens manually — the library takes care of it, letting you focus on building functionality.
This library simplifies that process by wrapping SOAP communication into a clean, Pythonic API. You no longer need to handle low-level XML parsing, namespaces, or security tokens manually — the library takes care of it, letting you focus on building functionality.
## Key Features
- Full implementation of ONVIF core services and profiles
- Support for device discovery, media streaming, PTZ control, event management, and more
- Pythonic abstraction over SOAP requests and responses (no need to handcraft XML)
- Extensible architecture for custom ONVIF extensions
- Compatible with multiple ONVIF specification versions
- Example scripts and tests included
## Library Philosophy
> [!NOTE]
> This library will be continuously updated as ONVIF versions are updated. It uses a built-in WSDL that will always follow changes to the [ONVIF WSDL Specifications](https://github.com/onvif/specs). You can also use your own ONVIF WSDL file by adding the `wsdl_dir` argument; see [ONVIFClient Parameters](#onvifclient-parameters).
- **WYSIWYG (What You See is What You Get)**: Every ONVIF operation in the library mirrors the official ONVIF specification exactly. Method names, parameter structures, and response formats follow ONVIF standards without abstraction layers or renamed interfaces. What you see in the ONVIF documentation is exactly what you get in Python.
- **Device Variety Interoperability**: Built to handle the real-world diversity of ONVIF implementations across manufacturers. The library gracefully handles missing features, optional operations, and vendor-specific behaviors through comprehensive error handling and fallback mechanisms. Whether you're working with high-end enterprise cameras or budget IP cameras, the library adapts.
- **Official Specifications Accuracy**: All service implementations are generated and validated against official `ONVIF WSDL Specifications`. The library includes comprehensive test suites that verify compliance with ONVIF standards, ensuring that method signatures, parameter types, and behavior match the official specifications precisely.
- **Modern Python Approach**: Designed for excellent IDE support with full type hints, auto-completion, and immediate error detection. You'll get `TypeError` exceptions upfront when accessing ONVIF operations with wrong arguments, instead of cryptic `SOAP faults` later. Clean, Pythonic API that feels natural to Python developers while maintaining ONVIF compatibility.
- **Minimal Dependencies**: Only depends on essential, well-maintained libraries (`zeep` for SOAP, `requests` for HTTP). No bloated framework dependencies or custom XML parsers. The library stays lightweight while providing full ONVIF functionality, making it easy to integrate into any project without dependency conflicts.
## Who Is It For?

@@ -356,7 +362,8 @@ - **Individual developers** exploring ONVIF or building hobby projects

```bash
usage: onvif [-h] [--host HOST] [--port PORT] [--username USERNAME] [--password PASSWORD] [--discover] [--filter FILTER] [--search SEARCH] [--page PAGE] [--per-page PER_PAGE] [--timeout TIMEOUT] [--https]
[--no-verify] [--no-patch] [--interactive] [--debug] [--wsdl WSDL] [--cache {all,db,mem,none}] [--health-check-interval HEALTH_CHECK_INTERVAL] [--version]
usage: onvif [-h] [--host HOST] [--port PORT] [--username USERNAME] [--password PASSWORD] [--discover] [--filter FILTER] [--search SEARCH] [--page PAGE]
[--per-page PER_PAGE] [--timeout TIMEOUT] [--https] [--no-verify] [--no-patch] [--interactive] [--debug] [--wsdl WSDL]
[--cache {all,db,mem,none}] [--health-check-interval HEALTH_CHECK_INTERVAL] [--output OUTPUT] [--version]
[service] [method] [params ...]
ONVIF Terminal Client — v0.2.4
ONVIF Terminal Client — v0.2.5
https://github.com/nirsimetri/onvif-python

@@ -395,2 +402,5 @@

Health check interval in seconds for interactive mode (default: 10)
--output OUTPUT, -o OUTPUT
Save command output to file. Supports .json, .xml extensions for format detection, or plain text. XML format automatically enables
debug mode for SOAP capture.
--version, -v Show ONVIF CLI version and exit

@@ -416,4 +426,9 @@

onvif devicemgmt GetCapabilities Category=All --host 192.168.1.17 --port 8000 --username admin --password admin123
onvif ptz ContinuousMove ProfileToken=Profile_1 Velocity={"PanTilt": {"x": -0.1, "y": 0}} --host 192.168.1.17 --port 8000 --username admin --password admin123
onvif ptz ContinuousMove ProfileToken=Profile_1 Velocity={'PanTilt': {'x': -0.1, 'y': 0}} -H 192.168.1.17 -P 8000 -u admin -p admin123
# Save output to file
onvif devicemgmt GetDeviceInformation --host 192.168.1.17 --port 8000 --username admin --password admin123 --output device_info.json
onvif media GetProfiles --host 192.168.1.17 --port 8000 --username admin --password admin123 --output profiles.xml
onvif ptz GetConfigurations --host 192.168.1.17 --port 8000 --username admin --password admin123 --output ptz_config.txt --debug
# Interactive mode

@@ -436,3 +451,3 @@ onvif --host 192.168.1.17 --port 8000 --username admin --password admin123 --interactive

```bash
ONVIF Interactive Shell — v0.2.4
ONVIF Interactive Shell — v0.2.5
https://github.com/nirsimetri/onvif-python

@@ -645,3 +660,7 @@

# Move a PTZ camera
onvif ptz ContinuousMove ProfileToken=Profile_1 Velocity='{"PanTilt": {"x": 0.1}}' -H 192.168.1.17 -P 8000 -u admin -p admin123
onvif ptz ContinuousMove ProfileToken=Profile_1 Velocity='{"PanTilt": {"x": 0.1, "y": 0}}' -H 192.168.1.17 -P 8000 -u admin -p admin123
# Save output to file
onvif devicemgmt GetDeviceInformation --host 192.168.1.17 --port 8000 --username admin --password admin123 --output device_info.json
onvif media GetProfiles -H 192.168.1.17 -P 8000 -u admin -p admin123 -o profiles.xml
```

@@ -1162,4 +1181,2 @@

- [ ] Add community-contributed device configuration templates.
- [ ] Implement missing or partial ONVIF services.
- [ ] Add function to expose ONVIF devices (for debugging purposes by the community).

@@ -1169,3 +1186,3 @@ ## Related Projects

- [onvif-products-directory](https://github.com/nirsimetri/onvif-products-directory):
This project is a comprehensive ONVIF data aggregation and management suite, designed to help developers explore, analyze, and process ONVIF-compliant product information from hundreds of manufacturers worldwide. It provides a unified structure for device, client, and company data, making it easier to perform research, build integrations, and generate statistics for ONVIF ecosystem analysis.
This project is a comprehensive ONVIF data aggregation and management suite, designed to help developers explore, analyze, and process ONVIF-compliant product information from hundreds of manufacturers worldwide.

@@ -1172,0 +1189,0 @@ - (soon) [onvif-rest-server](https://github.com/nirsimetri/onvif-rest-server):

@@ -7,3 +7,3 @@ [build-system]

name = "onvif-python"
version = "0.2.4"
version = "0.2.5"
description = "A modern Python library for ONVIF-compliant devices"

@@ -10,0 +10,0 @@ readme = "README.md"

+40
-23
<h1 align="center">ONVIF Python</h1>
<div align="center">
<img alt="Codacy grade" src="https://img.shields.io/codacy/grade/bff08a94e4d447b690cea49c6594826d?label=Code%20Quality&logo=codacy" href="https://app.codacy.com/gh/nirsimetri/onvif-python/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade">
<img alt="Ask DeepWiki" src="https://deepwiki.com/badge.svg" href="https://deepwiki.com/nirsimetri/onvif-python">
<img alt="PyPI Version" src="https://img.shields.io/badge/PyPI-0.2.4-orange?logo=archive&color=yellow" href="https://pypi.org/project/onvif-python/">
<img alt="Pepy Total Downloads" src="https://img.shields.io/pepy/dt/onvif-python?label=Downloads&color=red" href="https://pepy.tech/projects/onvif-python">
<a href="https://app.codacy.com/gh/nirsimetri/onvif-python/dashboard?utm_source=gh&utm_medium=referral&utm_content=&utm_campaign=Badge_grade"><img alt="Codacy grade" src="https://img.shields.io/codacy/grade/bff08a94e4d447b690cea49c6594826d?label=Code%20Quality&logo=codacy"></a>
<a href="https://deepwiki.com/nirsimetri/onvif-python"><img alt="Ask DeepWiki" src="https://deepwiki.com/badge.svg"></a>
<a href="https://pypi.org/project/onvif-python/"><img alt="PyPI Version" src="https://img.shields.io/badge/PyPI-0.2.5-orange?logo=archive&color=yellow"></a>
<a href="https://pepy.tech/projects/onvif-python"><img alt="Pepy Total Downloads" src="https://img.shields.io/pepy/dt/onvif-python?label=Downloads&color=red"></a>
<br>
<img alt="Build" src="https://github.com/nirsimetri/onvif-python/actions/workflows/python-app.yml/badge.svg?branch=main" href="https://github.com/nirsimetri/onvif-python/actions/workflows/python-app.yml">
<img alt="Upload Python Package" src="https://github.com/nirsimetri/onvif-python/actions/workflows/python-publish.yml/badge.svg" href="https://github.com/nirsimetri/onvif-python/actions/workflows/python-publish.yml">
<a href="https://github.com/nirsimetri/onvif-python/actions/workflows/python-app.yml"><img alt="Build" src="https://github.com/nirsimetri/onvif-python/actions/workflows/python-app.yml/badge.svg?branch=main"></a>
<a href="https://github.com/nirsimetri/onvif-python/actions/workflows/python-publish.yml"><img alt="Upload Python Package" src="https://github.com/nirsimetri/onvif-python/actions/workflows/python-publish.yml/badge.svg"></a>
</div>

@@ -24,12 +24,18 @@

This library simplifies that process by wrapping SOAP communication into a clean, Pythonic API. You no longer need to handle low-level XML parsing, namespaces, or security tokens manually — the library takes care of it, letting you focus on building functionality.
This library simplifies that process by wrapping SOAP communication into a clean, Pythonic API. You no longer need to handle low-level XML parsing, namespaces, or security tokens manually — the library takes care of it, letting you focus on building functionality.
## Key Features
- Full implementation of ONVIF core services and profiles
- Support for device discovery, media streaming, PTZ control, event management, and more
- Pythonic abstraction over SOAP requests and responses (no need to handcraft XML)
- Extensible architecture for custom ONVIF extensions
- Compatible with multiple ONVIF specification versions
- Example scripts and tests included
## Library Philosophy
> [!NOTE]
> This library will be continuously updated as ONVIF versions are updated. It uses a built-in WSDL that will always follow changes to the [ONVIF WSDL Specifications](https://github.com/onvif/specs). You can also use your own ONVIF WSDL file by adding the `wsdl_dir` argument; see [ONVIFClient Parameters](#onvifclient-parameters).
- **WYSIWYG (What You See is What You Get)**: Every ONVIF operation in the library mirrors the official ONVIF specification exactly. Method names, parameter structures, and response formats follow ONVIF standards without abstraction layers or renamed interfaces. What you see in the ONVIF documentation is exactly what you get in Python.
- **Device Variety Interoperability**: Built to handle the real-world diversity of ONVIF implementations across manufacturers. The library gracefully handles missing features, optional operations, and vendor-specific behaviors through comprehensive error handling and fallback mechanisms. Whether you're working with high-end enterprise cameras or budget IP cameras, the library adapts.
- **Official Specifications Accuracy**: All service implementations are generated and validated against official `ONVIF WSDL Specifications`. The library includes comprehensive test suites that verify compliance with ONVIF standards, ensuring that method signatures, parameter types, and behavior match the official specifications precisely.
- **Modern Python Approach**: Designed for excellent IDE support with full type hints, auto-completion, and immediate error detection. You'll get `TypeError` exceptions upfront when accessing ONVIF operations with wrong arguments, instead of cryptic `SOAP faults` later. Clean, Pythonic API that feels natural to Python developers while maintaining ONVIF compatibility.
- **Minimal Dependencies**: Only depends on essential, well-maintained libraries (`zeep` for SOAP, `requests` for HTTP). No bloated framework dependencies or custom XML parsers. The library stays lightweight while providing full ONVIF functionality, making it easy to integrate into any project without dependency conflicts.
## Who Is It For?

@@ -312,7 +318,8 @@ - **Individual developers** exploring ONVIF or building hobby projects

```bash
usage: onvif [-h] [--host HOST] [--port PORT] [--username USERNAME] [--password PASSWORD] [--discover] [--filter FILTER] [--search SEARCH] [--page PAGE] [--per-page PER_PAGE] [--timeout TIMEOUT] [--https]
[--no-verify] [--no-patch] [--interactive] [--debug] [--wsdl WSDL] [--cache {all,db,mem,none}] [--health-check-interval HEALTH_CHECK_INTERVAL] [--version]
usage: onvif [-h] [--host HOST] [--port PORT] [--username USERNAME] [--password PASSWORD] [--discover] [--filter FILTER] [--search SEARCH] [--page PAGE]
[--per-page PER_PAGE] [--timeout TIMEOUT] [--https] [--no-verify] [--no-patch] [--interactive] [--debug] [--wsdl WSDL]
[--cache {all,db,mem,none}] [--health-check-interval HEALTH_CHECK_INTERVAL] [--output OUTPUT] [--version]
[service] [method] [params ...]
ONVIF Terminal Client — v0.2.4
ONVIF Terminal Client — v0.2.5
https://github.com/nirsimetri/onvif-python

@@ -351,2 +358,5 @@

Health check interval in seconds for interactive mode (default: 10)
--output OUTPUT, -o OUTPUT
Save command output to file. Supports .json, .xml extensions for format detection, or plain text. XML format automatically enables
debug mode for SOAP capture.
--version, -v Show ONVIF CLI version and exit

@@ -372,4 +382,9 @@

onvif devicemgmt GetCapabilities Category=All --host 192.168.1.17 --port 8000 --username admin --password admin123
onvif ptz ContinuousMove ProfileToken=Profile_1 Velocity={"PanTilt": {"x": -0.1, "y": 0}} --host 192.168.1.17 --port 8000 --username admin --password admin123
onvif ptz ContinuousMove ProfileToken=Profile_1 Velocity={'PanTilt': {'x': -0.1, 'y': 0}} -H 192.168.1.17 -P 8000 -u admin -p admin123
# Save output to file
onvif devicemgmt GetDeviceInformation --host 192.168.1.17 --port 8000 --username admin --password admin123 --output device_info.json
onvif media GetProfiles --host 192.168.1.17 --port 8000 --username admin --password admin123 --output profiles.xml
onvif ptz GetConfigurations --host 192.168.1.17 --port 8000 --username admin --password admin123 --output ptz_config.txt --debug
# Interactive mode

@@ -392,3 +407,3 @@ onvif --host 192.168.1.17 --port 8000 --username admin --password admin123 --interactive

```bash
ONVIF Interactive Shell — v0.2.4
ONVIF Interactive Shell — v0.2.5
https://github.com/nirsimetri/onvif-python

@@ -601,3 +616,7 @@

# Move a PTZ camera
onvif ptz ContinuousMove ProfileToken=Profile_1 Velocity='{"PanTilt": {"x": 0.1}}' -H 192.168.1.17 -P 8000 -u admin -p admin123
onvif ptz ContinuousMove ProfileToken=Profile_1 Velocity='{"PanTilt": {"x": 0.1, "y": 0}}' -H 192.168.1.17 -P 8000 -u admin -p admin123
# Save output to file
onvif devicemgmt GetDeviceInformation --host 192.168.1.17 --port 8000 --username admin --password admin123 --output device_info.json
onvif media GetProfiles -H 192.168.1.17 -P 8000 -u admin -p admin123 -o profiles.xml
```

@@ -1118,4 +1137,2 @@

- [ ] Add community-contributed device configuration templates.
- [ ] Implement missing or partial ONVIF services.
- [ ] Add function to expose ONVIF devices (for debugging purposes by the community).

@@ -1125,3 +1142,3 @@ ## Related Projects

- [onvif-products-directory](https://github.com/nirsimetri/onvif-products-directory):
This project is a comprehensive ONVIF data aggregation and management suite, designed to help developers explore, analyze, and process ONVIF-compliant product information from hundreds of manufacturers worldwide. It provides a unified structure for device, client, and company data, making it easier to perform research, build integrations, and generate statistics for ONVIF ecosystem analysis.
This project is a comprehensive ONVIF data aggregation and management suite, designed to help developers explore, analyze, and process ONVIF-compliant product information from hundreds of manufacturers worldwide.

@@ -1128,0 +1145,0 @@ - (soon) [onvif-rest-server](https://github.com/nirsimetri/onvif-rest-server):