onvif-python 0.1.0__tar.gz → 0.1.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (131) hide show
  1. {onvif_python-0.1.0/onvif_python.egg-info → onvif_python-0.1.2}/PKG-INFO +308 -56
  2. {onvif_python-0.1.0 → onvif_python-0.1.2}/README.md +307 -55
  3. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/__init__.py +2 -0
  4. onvif_python-0.1.2/onvif/cli/__init__.py +5 -0
  5. onvif_python-0.1.2/onvif/cli/__main__.py +11 -0
  6. onvif_python-0.1.2/onvif/cli/interactive.py +1166 -0
  7. onvif_python-0.1.2/onvif/cli/main.py +472 -0
  8. onvif_python-0.1.2/onvif/cli/utils.py +475 -0
  9. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/client.py +20 -19
  10. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/operator.py +0 -1
  11. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/utils/error_handlers.py +2 -3
  12. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/utils/exceptions.py +28 -6
  13. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/utils/wsdl.py +267 -41
  14. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/utils/xml_capture.py +1 -1
  15. {onvif_python-0.1.0 → onvif_python-0.1.2/onvif_python.egg-info}/PKG-INFO +308 -56
  16. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif_python.egg-info/SOURCES.txt +7 -0
  17. onvif_python-0.1.2/onvif_python.egg-info/entry_points.txt +2 -0
  18. {onvif_python-0.1.0 → onvif_python-0.1.2}/pyproject.toml +4 -1
  19. onvif_python-0.1.2/tests/test_client.py +278 -0
  20. onvif_python-0.1.2/tests/test_core.py +378 -0
  21. onvif_python-0.1.2/tests/test_error_handlers.py +344 -0
  22. onvif_python-0.1.2/tests/test_exceptions.py +339 -0
  23. onvif_python-0.1.2/tests/test_wsdl_map.py +47 -0
  24. onvif_python-0.1.0/tests/test_client.py +0 -0
  25. onvif_python-0.1.0/tests/test_core.py +0 -0
  26. onvif_python-0.1.0/tests/test_exceptions.py +0 -0
  27. onvif_python-0.1.0/tests/test_wsdl_map.py +0 -27
  28. {onvif_python-0.1.0 → onvif_python-0.1.2}/LICENSE.md +0 -0
  29. {onvif_python-0.1.0 → onvif_python-0.1.2}/MANIFEST.in +0 -0
  30. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/__init__.py +0 -0
  31. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/accesscontrol.py +0 -0
  32. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/accessrules.py +0 -0
  33. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/actionengine.py +0 -0
  34. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/analytics/analytics.py +0 -0
  35. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/analytics/ruleengine.py +0 -0
  36. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/analyticsdevice.py +0 -0
  37. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/appmgmt.py +0 -0
  38. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/authenticationbehavior.py +0 -0
  39. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/credential.py +0 -0
  40. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/deviceio.py +0 -0
  41. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/devicemgmt.py +0 -0
  42. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/display.py +0 -0
  43. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/doorcontrol.py +0 -0
  44. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/events/events.py +0 -0
  45. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/events/notification.py +0 -0
  46. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/events/pullpoint.py +0 -0
  47. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/events/subscription.py +0 -0
  48. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/imaging.py +0 -0
  49. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/media.py +0 -0
  50. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/media2.py +0 -0
  51. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/provisioning.py +0 -0
  52. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/ptz.py +0 -0
  53. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/receiver.py +0 -0
  54. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/recording.py +0 -0
  55. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/replay.py +0 -0
  56. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/schedule.py +0 -0
  57. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/search.py +0 -0
  58. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/security/advancedsecurity.py +0 -0
  59. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/security/authorizationserver.py +0 -0
  60. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/security/dot1x.py +0 -0
  61. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/security/jwt.py +0 -0
  62. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/security/keystore.py +0 -0
  63. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/security/mediasigning.py +0 -0
  64. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/security/tlsserver.py +0 -0
  65. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/thermal.py +0 -0
  66. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/services/uplink.py +0 -0
  67. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/utils/__init__.py +0 -0
  68. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/utils/zeep.py +0 -0
  69. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/accesscontrol/wsdl/index.html +0 -0
  70. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/accessrules/wsdl/accessrules.wsdl +0 -0
  71. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/accessrules/wsdl/index.html +0 -0
  72. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/actionengine.wsdl +0 -0
  73. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/advancedsecurity/wsdl/advancedsecurity.wsdl +0 -0
  74. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/advancedsecurity/wsdl/index.html +0 -0
  75. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/analyticsdevice.wsdl +0 -0
  76. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/appmgmt/wsdl/appmgmt.wsdl +0 -0
  77. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/appmgmt/wsdl/index.html +0 -0
  78. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/authenticationbehavior/wsdl/authenticationbehavior.wsdl +0 -0
  79. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/authenticationbehavior/wsdl/index.html +0 -0
  80. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/credential/wsdl/credential.wsdl +0 -0
  81. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/credential/wsdl/index.html +0 -0
  82. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/device/wsdl/devicemgmt.wsdl +0 -0
  83. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/deviceio.wsdl +0 -0
  84. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/display/display.wsdl +0 -0
  85. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/display/wsdl/index.htm +0 -0
  86. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/display.wsdl +0 -0
  87. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/doorcontrol/wsdl/index.html +0 -0
  88. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/events/wsdl/bw-2-vs-mod.wsdl +0 -0
  89. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/events/wsdl/event-vs.wsdl +0 -0
  90. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/events/wsdl/event.wsdl +0 -0
  91. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/events/wsdl/index.html +0 -0
  92. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/federatedsearch.wsdl +0 -0
  93. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/media/wsdl/media.wsdl +0 -0
  94. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/pacs/accesscontrol.wsdl +0 -0
  95. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/pacs/doorcontrol.wsdl +0 -0
  96. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/pacs/types.xsd +0 -0
  97. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/provisioning/wsdl/provisioning.wsdl +0 -0
  98. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/receiver.wsdl +0 -0
  99. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/recording.wsdl +0 -0
  100. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/replay.wsdl +0 -0
  101. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/schedule/wsdl/index.html +0 -0
  102. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/schedule/wsdl/schedule.wsdl +0 -0
  103. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/schema/common.xsd +0 -0
  104. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/schema/metadatastream.xsd +0 -0
  105. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/schema/onvif.xsd +0 -0
  106. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/search.wsdl +0 -0
  107. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/thermal/wsdl/index.html +0 -0
  108. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/thermal/wsdl/thermal.wsdl +0 -0
  109. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/topics/topicns.xml +0 -0
  110. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/uplink/wsdl/index.html +0 -0
  111. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver10/uplink/wsdl/uplink.wsdl +0 -0
  112. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver20/analytics/humanbody.xsd +0 -0
  113. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver20/analytics/humanface.xsd +0 -0
  114. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver20/analytics/index.html +0 -0
  115. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver20/analytics/radiometry.xsd +0 -0
  116. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver20/analytics/rules.xsd +0 -0
  117. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver20/analytics/wsdl/analytics.wsdl +0 -0
  118. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver20/analytics/wsdl/index.html +0 -0
  119. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver20/imaging/wsdl/imaging.wsdl +0 -0
  120. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver20/media/wsdl/index.html +0 -0
  121. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver20/media/wsdl/media.wsdl +0 -0
  122. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver20/ptz/wsdl/ptz.wsdl +0 -0
  123. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver20/util/federated_search_documentation.html +0 -0
  124. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver20/util/fedsearch-docu-viewer.xsl +0 -0
  125. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver20/util/onvif-wsdl-viewer.xsl +0 -0
  126. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif/wsdl/ver20/util/operationIndex.html +0 -0
  127. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif_python.egg-info/dependency_links.txt +0 -0
  128. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif_python.egg-info/requires.txt +0 -0
  129. {onvif_python-0.1.0 → onvif_python-0.1.2}/onvif_python.egg-info/top_level.txt +0 -0
  130. {onvif_python-0.1.0 → onvif_python-0.1.2}/setup.cfg +0 -0
  131. {onvif_python-0.1.0 → onvif_python-0.1.2}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: onvif-python
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: A comprehensive and developer-friendly Python library for working with ONVIF-compliant devices
5
5
  Author-email: Nirsimetri Technologies® <open@nirsimetri.com>
6
6
  Maintainer: Kaburagi
@@ -40,10 +40,11 @@ Dynamic: license-file
40
40
 
41
41
  [![License](https://img.shields.io/badge/License-MIT-blue)](https://github.com/nirsimetri/onvif-python?tab=MIT-1-ov-file)
42
42
  [![DeepWiki](https://img.shields.io/badge/DeepWiki-AI%20Wiki-orange)](https://deepwiki.com/nirsimetri/onvif-python)
43
- [![Release](https://img.shields.io/badge/Release-v0.1.0-red?logo=archive)](https://github.com/nirsimetri/onvif-python/releases)
44
- <br>
45
- [![PyPI](https://img.shields.io/badge/PyPI-0.1.0-yellow?logo=archive)](https://pypi.org/project/onvif-python/)
43
+ [![PyPI](https://img.shields.io/badge/PyPI-0.1.2-yellow?logo=archive)](https://pypi.org/project/onvif-python/)
46
44
  [![Downloads](https://img.shields.io/pypi/dm/onvif-python?label=PyPI%20Downloads)](https://clickpy.clickhouse.com/dashboard/onvif-python)
45
+ <br>
46
+ [![Build](https://github.com/nirsimetri/onvif-python/actions/workflows/python-app.yml/badge.svg?branch=main)](https://github.com/nirsimetri/onvif-python/actions/workflows/python-app.yml)
47
+ [![Upload Python Package](https://github.com/nirsimetri/onvif-python/actions/workflows/python-publish.yml/badge.svg)](https://github.com/nirsimetri/onvif-python/actions/workflows/python-publish.yml)
47
48
 
48
49
  **This project provides a comprehensive and developer-friendly Python library for working with ONVIF-compliant devices.** It is designed to be reliable, easy to integrate, and flexible enough to support a wide range of ONVIF profiles and services.
49
50
 
@@ -66,6 +67,13 @@ This library simplifies that process by wrapping SOAP communication into a clean
66
67
  - **Companies** building video intelligence, analytics, or VMS platforms
67
68
  - **Security integrators** who need reliable ONVIF interoperability across devices
68
69
 
70
+ ## Requirements
71
+
72
+ - **Python**: 3.9 or higher
73
+ - **Dependencies**:
74
+ - [`zeep>=4.3.0`](https://github.com/mvantellingen/python-zeep) - SOAP client for ONVIF communication
75
+ - [`requests>=2.32.0`](https://github.com/psf/requests) - HTTP library for network requests
76
+
69
77
  ## Installation
70
78
 
71
79
  From official [PyPI](https://pypi.org/project/onvif-python/):
@@ -151,6 +159,297 @@ Explore more advanced usage and service-specific operations in the [`examples/`]
151
159
  > [!IMPORTANT]
152
160
  > If you're new to ONVIF and want to learn more, we highly recommend taking the official free online course provided by ONVIF at [Introduction to ONVIF Course](https://www.onvif.org/about/introduction-to-onvif-course). Please note that we are not endorsed or sponsored by ONVIF, see [Legal Notice](#legal-notice) for details.
153
161
 
162
+ ## ONVIF CLI
163
+
164
+ > [!NOTE]
165
+ > The CLI is automatically installed when you install the `onvif-python` see [Installation](#installation). This feature has been available since `onvif-python` version [`0.1.1`](https://github.com/nirsimetri/onvif-python/releases/tag/v0.1.1).
166
+
167
+ ![Windows](https://img.shields.io/badge/Windows-0078D6?style=plastic&logo=gitforwindows&logoColor=white)
168
+ ![Linux](https://img.shields.io/badge/Linux-FCC624?style=plastic&logo=linux&logoColor=black)
169
+ ![macOS](https://img.shields.io/badge/macOS-1A9FEE?style=plastic&logo=apple&logoColor=black)
170
+ ![Raspberry Pi](https://img.shields.io/badge/Raspberry%20Pi-A22846?style=plastic&logo=raspberrypi&logoColor=black)
171
+
172
+ This library includes a powerful command-line interface (CLI) for interacting with ONVIF devices directly from your terminal. It supports both direct command execution and an interactive shell mode, providing a flexible and efficient way to manage and debug ONVIF devices.
173
+
174
+ ### Features
175
+
176
+ - **Interactive Shell:** A user-friendly shell with tab completion, command history, and colorized output.
177
+ - **Direct Command Execution:** Run ONVIF commands directly from the terminal for scripting and automation.
178
+ - **Automatic Discovery:** Automatically detects available services on the device.
179
+ - **Connection Management:** Supports HTTP/HTTPS, custom timeouts, and SSL verification.
180
+ - **Data Management:** Store results from commands and use them as parameters in subsequent commands.
181
+ - **Cross-Platform:** Works on Windows, macOS, Linux, and Raspberry Pi.
182
+
183
+ ### Screenshoot
184
+
185
+ <table>
186
+ <tr>
187
+ <td width="34.2%">
188
+ <a href="https://github.com/nirsimetri/onvif-python">
189
+ <img src="./assets/onvif_cli.png" />
190
+ </a>
191
+ </td>
192
+ <td width="65.8%">
193
+ <a href="https://github.com/nirsimetri/onvif-python">
194
+ <img src="./assets/onvif_operations.png" />
195
+ </a>
196
+ </td>
197
+ </tr>
198
+ <tr>
199
+ <th align="center">
200
+ Onboarding
201
+ </th>
202
+ <th align="center">
203
+ List available operations
204
+ </th>
205
+ </tr>
206
+ </table>
207
+
208
+ ### Help Command
209
+
210
+ <details>
211
+ <summary><b>1. Direct CLI</b></summary>
212
+
213
+ ```bash
214
+ usage: onvif [-h] [--host HOST] [--port PORT] [--username USERNAME] [--password PASSWORD] [--discover] [--timeout TIMEOUT] [--https] [--no-verify]
215
+ [--no-patch] [--interactive] [--debug] [--wsdl WSDL] [--cache {all,db,mem,none}]
216
+ [service] [method] [params ...]
217
+
218
+ ONVIF Terminal Client —
219
+ https://github.com/nirsimetri/onvif-python
220
+
221
+ positional arguments:
222
+ service ONVIF service name (e.g., devicemgmt, media, ptz)
223
+ method Service method name (e.g., GetCapabilities, GetProfiles)
224
+ params Method parameters as Simple Parameter or JSON string
225
+
226
+ options:
227
+ -h, --help show this help message and exit
228
+ --host HOST, -H HOST ONVIF device IP address or hostname
229
+ --port PORT, -P PORT ONVIF device port (default: 80)
230
+ --username USERNAME, -u USERNAME
231
+ Username for authentication
232
+ --password PASSWORD, -p PASSWORD
233
+ Password for authentication
234
+ --discover, -d Discover ONVIF devices on the network using WS-Discovery
235
+ --timeout TIMEOUT Connection timeout in seconds (default: 10)
236
+ --https Use HTTPS instead of HTTP
237
+ --no-verify Disable SSL certificate verification
238
+ --no-patch Disable ZeepPatcher
239
+ --interactive, -i Start interactive mode
240
+ --debug Enable debug mode with XML capture
241
+ --wsdl WSDL Custom WSDL directory path
242
+ --cache {all,db,mem,none}
243
+ Caching mode for ONVIFClient (default: all). 'all': memory+disk, 'db': disk-only, 'mem': memory-only, 'none': disabled.
244
+
245
+ Examples:
246
+ # Discover ONVIF devices on network
247
+ onvif --discover --username admin --password admin123 --interactive
248
+ onvif media GetProfiles --discover --username admin
249
+ onvif -d -i
250
+
251
+ # Direct command execution
252
+ onvif devicemgmt GetCapabilities Category=All --host 192.168.1.17 --port 8000 --username admin --password admin123
253
+ onvif ptz ContinuousMove ProfileToken=Profile_1 Velocity={"PanTilt": {"x": -0.1, "y": 0}} --host 192.168.1.17 --port 8000 --username admin --password admin123
254
+
255
+ # Interactive mode
256
+ onvif --host 192.168.1.17 --port 8000 --username admin --password admin123 --interactive
257
+
258
+ # Prompting for username and password
259
+ # (if not provided)
260
+ onvif -H 192.168.1.17 -P 8000 -i
261
+
262
+ # Using HTTPS
263
+ onvif media GetProfiles --host camera.example.com --port 443 --username admin --password admin123 --https
264
+ ```
265
+
266
+ </details>
267
+
268
+ <details>
269
+ <summary><b>2. Interactive Shell</b></summary>
270
+
271
+ ```bash
272
+ ONVIF Interactive Shell Commands -
273
+ https://github.com/nirsimetri/onvif-python
274
+
275
+ Basic Commands:
276
+ capabilities, caps - Show device capabilities
277
+ services - Show available services with details
278
+ info - Show connection and device information
279
+ exit, quit - Exit the shell
280
+ shortcuts - Show available shortcuts
281
+
282
+ Navigation Commands:
283
+ <service> - Enter service mode (e.g., devicemgmt, media)
284
+ cd <service> - Enter service mode (alias)
285
+ ls - List commands/services/methods in grid format
286
+ up - Exit current service mode (go up one level)
287
+ pwd - Show current service context
288
+ clear - Clear terminal screen
289
+ desc <method> - Show method documentation in service mode
290
+
291
+ Method Execution:
292
+ <method> - Execute method without parameters
293
+ <method> {"param": "value"} - Execute method with JSON parameters
294
+ <method> param=value - Execute method with simple parameters
295
+
296
+ Data Management:
297
+ store <name> - Store last result with a name
298
+ show <name> - Show stored data
299
+ show <name>.attribute - Show specific attribute
300
+ show - List all stored data
301
+ rm <name> - Remove stored data by name
302
+ cls - Clear all stored data
303
+
304
+ Using Stored Data in Methods:
305
+ Use $variable syntax to reference stored data in method parameters:
306
+ - $profiles[0].token - Access list element and attribute
307
+ - $profiles[0].VideoSourceConfiguration.SourceToken
308
+
309
+ Example:
310
+ GetProfiles - Get profiles
311
+ store profiles - Store result
312
+ show profiles[0].token - Show first profile token
313
+ GetImagingSettings VideoSourceToken=$profiles[0].VideoSourceConfiguration.SourceToken
314
+
315
+ Debug Commands:
316
+ debug - Show last SOAP request & response (if --debug enabled)
317
+
318
+ Tab Completion:
319
+ Use TAB key for auto-completion of commands, services, and methods
320
+ Type partial commands to see suggestions
321
+
322
+ Examples:
323
+ 192.168.1.17:8000 > caps # Show capabilities
324
+ 192.168.1.17:8000 > dev<TAB> # Completes to 'devicemgmt'
325
+ 192.168.1.17:8000 > cd devicemgmt # Enter device management
326
+ 192.168.1.17:8000/devicemgmt > Get<TAB> # Show methods starting with 'Get'
327
+ 192.168.1.17:8000/devicemgmt > GetServices {"IncludeCapability": true}
328
+ 192.168.1.17:8000/devicemgmt > GetServices IncludeCapability=True
329
+ 192.168.1.17:8000/devicemgmt > store services_info
330
+ 192.168.1.17:8000/devicemgmt > up # Exit service mode
331
+ 192.168.1.17:8000 > # Back to root context
332
+ ```
333
+
334
+ </details>
335
+
336
+ ### Usage
337
+
338
+ **1. Interactive Mode**
339
+
340
+ The interactive shell is recommended for exploration and debugging. It provides an intuitive way to navigate services, call methods, and view results.
341
+
342
+ To start the interactive shell, provide the connection details:
343
+
344
+ ```bash
345
+ onvif --host 192.168.1.17 --port 8000 --username admin --password admin123 -i
346
+ ```
347
+
348
+ If you omit the username or password, you will be prompted to enter them securely.
349
+
350
+ **Interactive Shell Commands:**
351
+ | Command | Description |
352
+ |---|---|
353
+ | `help` | Show help information |
354
+ | `ls` | List available services or methods in the current context |
355
+ | `cd <service>` | Enter a service mode (e.g., `cd devicemgmt`) |
356
+ | `up` | Go back to the root context |
357
+ | `pwd` | Show the current service context |
358
+ | `desc <method>` | Show documentation for a method |
359
+ | `store <name>` | Store the last result with a variable name |
360
+ | `show <name>` | Display a stored variable |
361
+ | `exit` / `quit` | Exit the shell |
362
+
363
+ > [!IMPORTANT]
364
+ > You can see all the other commands available in the interactive shell by trying it out directly. The interactive shell runs periodic background health checks to detect connection loss. It uses silent TCP pings to avoid interrupting your work and will automatically exit if the device is unreachable, similar to an SSH session.
365
+
366
+ **2. Device Discovery (WS-Discovery)**
367
+
368
+ The CLI includes automatic ONVIF device discovery using the WS-Discovery protocol. This feature allows you to find all ONVIF-compliant devices on your local network without knowing their IP addresses beforehand.
369
+
370
+ **Discover and Connect Interactively:**
371
+ ```bash
372
+ # Discover devices and enter interactive mode
373
+ onvif --discover --username admin --password admin123 --interactive
374
+
375
+ # Short form
376
+ onvif -d -u admin -p admin123 -i
377
+ ```
378
+
379
+ **Discover and Execute Command:**
380
+ ```bash
381
+ # Discover devices and execute a command on the selected device
382
+ onvif media GetProfiles --discover --username admin --password admin123
383
+
384
+ # Short form
385
+ onvif media GetProfiles -d -u admin -p admin123
386
+ ```
387
+
388
+ **How Device Discovery Works:**
389
+
390
+ 1. **Automatic Network Scanning**: Sends a WS-Discovery Probe message to the multicast address `239.255.255.250:3702`
391
+ 2. **Device Detection**: Listens for ProbeMatch responses from ONVIF devices (default timeout: 4 seconds)
392
+ 3. **Interactive Selection**: Displays a numbered list of discovered devices with their details:
393
+ - Device UUID (Endpoint Reference)
394
+ - XAddrs (ONVIF service URLs)
395
+ - Device Types (e.g., NetworkVideoTransmitter)
396
+ - Scopes (name, location, hardware, profile information)
397
+ 4. **Connection**: Once you select a device, the CLI automatically connects using the discovered host and port
398
+
399
+ **Example Discovery Output:**
400
+ ```
401
+ Discovering ONVIF devices on network...
402
+ Network interface: 192.168.1.100
403
+ Timeout: 4s
404
+
405
+ Found 2 ONVIF device(s):
406
+
407
+ [1] 192.168.1.14:2020
408
+ [id] uuid:3fa1fe68-b915-4053-a3e1-a8294833fe3c
409
+ [xaddrs] http://192.168.1.14:2020/onvif/device_service
410
+ [types] tdn:NetworkVideoTransmitter
411
+ [scopes] [name/C210] [hardware/C210] [Profile/Streaming] [location/Hong Kong]
412
+
413
+ [2] 192.168.1.17:8000
414
+ [id] urn:uuid:7d04ff31-61e6-11f0-a00c-6056eef47207
415
+ [xaddrs] http://192.168.1.17:8000/onvif/device_service
416
+ [types] dn:NetworkVideoTransmitter tds:Device
417
+ [scopes] [type/NetworkVideoTransmitter] [location/unknown] [name/IPC_123465959]
418
+
419
+ Select device number 1-2 or q to quit: 1
420
+
421
+ Selected: 192.168.1.14:2020
422
+ ```
423
+
424
+ **Notes:**
425
+
426
+ - Discovery only works on the local network (same subnet)
427
+ - Some networks may block multicast traffic (check firewall settings)
428
+ - The `--host` and `--port` arguments are not required when using `--discover`
429
+ - You can still provide `--username` and `--password` upfront to avoid prompts
430
+
431
+ **3. Direct Command Execution**
432
+
433
+ You can also execute a single ONVIF command directly. This is useful for scripting or quick checks.
434
+
435
+ **Syntax:**
436
+ ```bash
437
+ onvif <service> <method> [parameters...] -H <host> -P <port> -u <user> -p <pass>
438
+ ```
439
+
440
+ **Example:**
441
+ ```bash
442
+ # Get device capabilities
443
+ onvif devicemgmt GetCapabilities Category=All -H 192.168.1.17 -P 8000 -u admin -p admin123
444
+
445
+ # Move a PTZ camera
446
+ onvif ptz ContinuousMove ProfileToken=Profile_1 Velocity='{"PanTilt": {"x": 0.1}}' -H 192.168.1.17 -P 8000 -u admin -p admin123
447
+ ```
448
+
449
+ ### CLI Parameters
450
+
451
+ All `ONVIFClient` parameters (like `--timeout`, `--https`, `--cache`, etc.) are available as command-line arguments. Use `onvif --help` to see all available options.
452
+
154
453
  ## ONVIFClient Parameters
155
454
 
156
455
  The `ONVIFClient` class provides various configuration options to customize the connection behavior, caching strategy, security settings, and debugging capabilities. Below is a detailed description of all available parameters:
@@ -193,9 +492,9 @@ The `ONVIFClient` class provides various configuration options to customize the
193
492
 
194
493
  | Parameter | Type | Required | Default | Description |
195
494
  |-----------|------|----------|---------|-------------|
196
- | `apply_patch` | `bool` | ❌ No | `True` | Enable zeep patching for better `xsd:any` field parsing and automatic flattening, applied at (>= [`v0.0.4`](https://github.com/nirsimetri/onvif-python/releases/tag/v0.0.4)) |
197
- | `capture_xml` | `bool` | ❌ No | `False` | Enable XML capture plugin for debugging SOAP requests/responses, applied at (>= [`v0.0.6`](https://github.com/nirsimetri/onvif-python/releases/tag/v0.0.6)) |
198
- | `wsdl_dir` | `str` | ❌ No | `None` | Custom WSDL directory path for using external WSDL files instead of built-in ones (e.g., `/path/to/custom/wsdl`), applied at (>= [`v0.1.0`](https://github.com/nirsimetri/onvif-python/releases/tag/v0.1.0)) |
495
+ | `apply_patch` | `bool` | ❌ No | `True` | Enable zeep patching for better `xsd:any` field parsing and automatic flattening, applied at ([`>=v0.0.4`](https://github.com/nirsimetri/onvif-python/releases/tag/v0.0.4)) |
496
+ | `capture_xml` | `bool` | ❌ No | `False` | Enable XML capture plugin for debugging SOAP requests/responses, applied at ([`>=v0.0.6`](https://github.com/nirsimetri/onvif-python/releases/tag/v0.0.6)) |
497
+ | `wsdl_dir` | `str` | ❌ No | `None` | Custom WSDL directory path for using external WSDL files instead of built-in ones (e.g., `/path/to/custom/wsdl`), applied at ([`>=v0.1.0`](https://github.com/nirsimetri/onvif-python/releases/tag/v0.1.0)) |
199
498
 
200
499
  </details>
201
500
 
@@ -428,53 +727,6 @@ else:
428
727
  - **GetCapabilities** is **mandatory** for all ONVIF-compliant devices, ensuring broader compatibility
429
728
  - **Default URLs** guarantee basic connectivity even with non-compliant devices
430
729
 
431
- **Get detailed service information:**
432
-
433
- If you need comprehensive service details, you can manually call `GetServices` with capabilities:
434
-
435
- ```python
436
- device = client.devicemgmt()
437
-
438
- try:
439
- # Try to get detailed service information
440
- services = device.GetServices(IncludeCapability=True)
441
- for service in services:
442
- print(f"Service: {service.Namespace}")
443
- print(f"XAddr: {service.XAddr}")
444
- if hasattr(service, 'Capabilities'):
445
- print(f"Capabilities: {service.Capabilities}")
446
- except Exception:
447
- # Fallback to GetCapabilities for legacy devices
448
- capabilities = device.GetCapabilities()
449
- print("Capabilities:", capabilities)
450
- ```
451
-
452
- **Access capabilities information:**
453
-
454
- When using `GetCapabilities` fallback, you can access capability information:
455
-
456
- ```python
457
- device = client.devicemgmt()
458
-
459
- try:
460
- # Get capabilities information from device
461
- capabilities = device.GetCapabilities()
462
-
463
- # Main services (always available)
464
- print("Media XAddr:", getattr(capabilities.Media, 'XAddr', 'Not available'))
465
- print("PTZ XAddr:", getattr(capabilities.PTZ, 'XAddr', 'Not available'))
466
-
467
- # Extension services (device-dependent)
468
- ext = getattr(capabilities, 'Extension', None)
469
- if ext:
470
- print("DeviceIO XAddr:", getattr(ext.DeviceIO, 'XAddr', 'Not available'))
471
- print("Recording XAddr:", getattr(ext.Recording, 'XAddr', 'Not available'))
472
- print("Search XAddr:", getattr(ext.Search, 'XAddr', 'Not available'))
473
- print("Replay XAddr:", getattr(ext.Replay, 'XAddr', 'Not available'))
474
- except Exception as e:
475
- print(f"Error getting capabilities: {e}")
476
- ```
477
-
478
730
  > [!TIP]
479
731
  > The library handles service discovery automatically with intelligent fallback. You typically don't need to call discovery methods manually unless you need detailed capability information or want to refresh the service list after device configuration changes.
480
732
 
@@ -630,8 +882,8 @@ Some ONVIF services have multiple bindings in the same WSDL. These typically inc
630
882
  ## Future Improvements (Stay tuned and star ⭐ this repo)
631
883
 
632
884
  - [x] ~~Add debugging mode with raw xml on SOAP requests and responses.~~ ([c258162](https://github.com/nirsimetri/onvif-python/commit/c258162))
633
- - [x] ~~Add functionality for `ONVIFClient` to accept a custom `wsdl_dir` service.~~ ([65f2570](https://github.com/nirsimetri/onvif-python/commit/65f257092e4c9daa23dd0d00825ed38a45d23b70))
634
- - [ ] Add `ONVIF CLI` program to interact directly with ONVIF devices via terminal.
885
+ - [x] ~~Add functionality for `ONVIFClient` to accept a custom `wsdl_dir` service.~~ ([65f2570](https://github.com/nirsimetri/onvif-python/commit/65f2570))
886
+ - [x] ~~Add `ONVIF CLI` program to interact directly with ONVIF devices via terminal.~~ ([645be01](https://github.com/nirsimetri/onvif-python/commit/645be01))
635
887
  - [ ] Add asynchronous (async/await) support for non-blocking ONVIF operations and concurrent device communication.
636
888
  - [ ] Implement structured data models for ONVIF Schemas using [xsdata](https://github.com/tefra/xsdata).
637
889
  - [ ] Integrate [xmltodict](https://github.com/martinblech/xmltodict) for simplified XML parsing and conversion.