onvif-python 0.1.0__tar.gz → 0.1.1__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.1}/PKG-INFO +82 -55
  2. {onvif_python-0.1.0 → onvif_python-0.1.1}/README.md +81 -54
  3. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/__init__.py +11 -0
  4. onvif_python-0.1.1/onvif/cli/__init__.py +5 -0
  5. onvif_python-0.1.1/onvif/cli/__main__.py +11 -0
  6. onvif_python-0.1.1/onvif/cli/interactive.py +1140 -0
  7. onvif_python-0.1.1/onvif/cli/main.py +216 -0
  8. onvif_python-0.1.1/onvif/cli/utils.py +476 -0
  9. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/client.py +18 -18
  10. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/utils/exceptions.py +27 -5
  11. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/utils/wsdl.py +267 -41
  12. {onvif_python-0.1.0 → onvif_python-0.1.1/onvif_python.egg-info}/PKG-INFO +82 -55
  13. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif_python.egg-info/SOURCES.txt +7 -0
  14. onvif_python-0.1.1/onvif_python.egg-info/entry_points.txt +2 -0
  15. {onvif_python-0.1.0 → onvif_python-0.1.1}/pyproject.toml +4 -1
  16. onvif_python-0.1.1/tests/test_client.py +278 -0
  17. onvif_python-0.1.1/tests/test_core.py +378 -0
  18. onvif_python-0.1.1/tests/test_error_handlers.py +344 -0
  19. onvif_python-0.1.1/tests/test_exceptions.py +339 -0
  20. onvif_python-0.1.1/tests/test_wsdl_map.py +47 -0
  21. onvif_python-0.1.0/tests/test_client.py +0 -0
  22. onvif_python-0.1.0/tests/test_core.py +0 -0
  23. onvif_python-0.1.0/tests/test_exceptions.py +0 -0
  24. onvif_python-0.1.0/tests/test_wsdl_map.py +0 -27
  25. {onvif_python-0.1.0 → onvif_python-0.1.1}/LICENSE.md +0 -0
  26. {onvif_python-0.1.0 → onvif_python-0.1.1}/MANIFEST.in +0 -0
  27. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/operator.py +0 -0
  28. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/__init__.py +0 -0
  29. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/accesscontrol.py +0 -0
  30. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/accessrules.py +0 -0
  31. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/actionengine.py +0 -0
  32. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/analytics/analytics.py +0 -0
  33. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/analytics/ruleengine.py +0 -0
  34. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/analyticsdevice.py +0 -0
  35. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/appmgmt.py +0 -0
  36. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/authenticationbehavior.py +0 -0
  37. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/credential.py +0 -0
  38. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/deviceio.py +0 -0
  39. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/devicemgmt.py +0 -0
  40. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/display.py +0 -0
  41. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/doorcontrol.py +0 -0
  42. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/events/events.py +0 -0
  43. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/events/notification.py +0 -0
  44. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/events/pullpoint.py +0 -0
  45. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/events/subscription.py +0 -0
  46. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/imaging.py +0 -0
  47. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/media.py +0 -0
  48. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/media2.py +0 -0
  49. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/provisioning.py +0 -0
  50. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/ptz.py +0 -0
  51. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/receiver.py +0 -0
  52. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/recording.py +0 -0
  53. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/replay.py +0 -0
  54. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/schedule.py +0 -0
  55. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/search.py +0 -0
  56. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/security/advancedsecurity.py +0 -0
  57. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/security/authorizationserver.py +0 -0
  58. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/security/dot1x.py +0 -0
  59. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/security/jwt.py +0 -0
  60. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/security/keystore.py +0 -0
  61. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/security/mediasigning.py +0 -0
  62. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/security/tlsserver.py +0 -0
  63. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/thermal.py +0 -0
  64. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/services/uplink.py +0 -0
  65. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/utils/__init__.py +0 -0
  66. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/utils/error_handlers.py +0 -0
  67. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/utils/xml_capture.py +0 -0
  68. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/utils/zeep.py +0 -0
  69. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/accesscontrol/wsdl/index.html +0 -0
  70. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/accessrules/wsdl/accessrules.wsdl +0 -0
  71. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/accessrules/wsdl/index.html +0 -0
  72. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/actionengine.wsdl +0 -0
  73. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/advancedsecurity/wsdl/advancedsecurity.wsdl +0 -0
  74. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/advancedsecurity/wsdl/index.html +0 -0
  75. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/analyticsdevice.wsdl +0 -0
  76. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/appmgmt/wsdl/appmgmt.wsdl +0 -0
  77. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/appmgmt/wsdl/index.html +0 -0
  78. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/authenticationbehavior/wsdl/authenticationbehavior.wsdl +0 -0
  79. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/authenticationbehavior/wsdl/index.html +0 -0
  80. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/credential/wsdl/credential.wsdl +0 -0
  81. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/credential/wsdl/index.html +0 -0
  82. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/device/wsdl/devicemgmt.wsdl +0 -0
  83. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/deviceio.wsdl +0 -0
  84. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/display/display.wsdl +0 -0
  85. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/display/wsdl/index.htm +0 -0
  86. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/display.wsdl +0 -0
  87. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/doorcontrol/wsdl/index.html +0 -0
  88. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/events/wsdl/bw-2-vs-mod.wsdl +0 -0
  89. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/events/wsdl/event-vs.wsdl +0 -0
  90. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/events/wsdl/event.wsdl +0 -0
  91. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/events/wsdl/index.html +0 -0
  92. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/federatedsearch.wsdl +0 -0
  93. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/media/wsdl/media.wsdl +0 -0
  94. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/pacs/accesscontrol.wsdl +0 -0
  95. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/pacs/doorcontrol.wsdl +0 -0
  96. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/pacs/types.xsd +0 -0
  97. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/provisioning/wsdl/provisioning.wsdl +0 -0
  98. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/receiver.wsdl +0 -0
  99. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/recording.wsdl +0 -0
  100. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/replay.wsdl +0 -0
  101. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/schedule/wsdl/index.html +0 -0
  102. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/schedule/wsdl/schedule.wsdl +0 -0
  103. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/schema/common.xsd +0 -0
  104. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/schema/metadatastream.xsd +0 -0
  105. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/schema/onvif.xsd +0 -0
  106. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/search.wsdl +0 -0
  107. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/thermal/wsdl/index.html +0 -0
  108. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/thermal/wsdl/thermal.wsdl +0 -0
  109. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/topics/topicns.xml +0 -0
  110. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/uplink/wsdl/index.html +0 -0
  111. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver10/uplink/wsdl/uplink.wsdl +0 -0
  112. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver20/analytics/humanbody.xsd +0 -0
  113. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver20/analytics/humanface.xsd +0 -0
  114. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver20/analytics/index.html +0 -0
  115. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver20/analytics/radiometry.xsd +0 -0
  116. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver20/analytics/rules.xsd +0 -0
  117. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver20/analytics/wsdl/analytics.wsdl +0 -0
  118. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver20/analytics/wsdl/index.html +0 -0
  119. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver20/imaging/wsdl/imaging.wsdl +0 -0
  120. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver20/media/wsdl/index.html +0 -0
  121. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver20/media/wsdl/media.wsdl +0 -0
  122. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver20/ptz/wsdl/ptz.wsdl +0 -0
  123. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver20/util/federated_search_documentation.html +0 -0
  124. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver20/util/fedsearch-docu-viewer.xsl +0 -0
  125. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver20/util/onvif-wsdl-viewer.xsl +0 -0
  126. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif/wsdl/ver20/util/operationIndex.html +0 -0
  127. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif_python.egg-info/dependency_links.txt +0 -0
  128. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif_python.egg-info/requires.txt +0 -0
  129. {onvif_python-0.1.0 → onvif_python-0.1.1}/onvif_python.egg-info/top_level.txt +0 -0
  130. {onvif_python-0.1.0 → onvif_python-0.1.1}/setup.cfg +0 -0
  131. {onvif_python-0.1.0 → onvif_python-0.1.1}/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.1
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,9 +40,9 @@ 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)
43
+ [![Release](https://img.shields.io/badge/Release-v0.1.1-red?logo=archive)](https://github.com/nirsimetri/onvif-python/releases)
44
44
  <br>
45
- [![PyPI](https://img.shields.io/badge/PyPI-0.1.0-yellow?logo=archive)](https://pypi.org/project/onvif-python/)
45
+ [![PyPI](https://img.shields.io/badge/PyPI-0.1.1-yellow?logo=archive)](https://pypi.org/project/onvif-python/)
46
46
  [![Downloads](https://img.shields.io/pypi/dm/onvif-python?label=PyPI%20Downloads)](https://clickpy.clickhouse.com/dashboard/onvif-python)
47
47
 
48
48
  **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.
@@ -66,6 +66,13 @@ This library simplifies that process by wrapping SOAP communication into a clean
66
66
  - **Companies** building video intelligence, analytics, or VMS platforms
67
67
  - **Security integrators** who need reliable ONVIF interoperability across devices
68
68
 
69
+ ## Requirements
70
+
71
+ - **Python**: 3.9 or higher
72
+ - **Dependencies**:
73
+ - [`zeep>=4.3.0`](https://github.com/mvantellingen/python-zeep) - SOAP client for ONVIF communication
74
+ - [`requests>=2.32.0`](https://github.com/psf/requests) - HTTP library for network requests
75
+
69
76
  ## Installation
70
77
 
71
78
  From official [PyPI](https://pypi.org/project/onvif-python/):
@@ -151,6 +158,73 @@ Explore more advanced usage and service-specific operations in the [`examples/`]
151
158
  > [!IMPORTANT]
152
159
  > 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
160
 
161
+ ## ONVIF CLI
162
+
163
+ > [!NOTE]
164
+ > 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.0](https://github.com/nirsimetri/onvif-python/releases/tag/v0.1.1)
165
+
166
+ 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.
167
+
168
+ ### Features
169
+
170
+ - **Interactive Shell:** A user-friendly shell with tab completion, command history, and colorized output.
171
+ - **Direct Command Execution:** Run ONVIF commands directly from the terminal for scripting and automation.
172
+ - **Automatic Discovery:** Automatically detects available services on the device.
173
+ - **Connection Management:** Supports HTTP/HTTPS, custom timeouts, and SSL verification.
174
+ - **Data Management:** Store results from commands and use them as parameters in subsequent commands.
175
+ - **Cross-Platform:** Works on Windows, macOS, and Linux.
176
+
177
+ ### Usage
178
+
179
+ **1. Interactive Mode**
180
+
181
+ The interactive shell is recommended for exploration and debugging. It provides an intuitive way to navigate services, call methods, and view results.
182
+
183
+ To start the interactive shell, provide the connection details:
184
+
185
+ ```bash
186
+ onvif --host 192.168.1.17 --port 8000 --username admin --password admin123 -i
187
+ ```
188
+
189
+ If you omit the username or password, you will be prompted to enter them securely.
190
+
191
+ **Interactive Shell Commands:**
192
+ | Command | Description |
193
+ |---|---|
194
+ | `help` | Show help information |
195
+ | `ls` | List available services or methods in the current context |
196
+ | `cd <service>` | Enter a service mode (e.g., `cd devicemgmt`) |
197
+ | `up` | Go back to the root context |
198
+ | `pwd` | Show the current service context |
199
+ | `desc <method>` | Show documentation for a method |
200
+ | `store <name>` | Store the last result with a variable name |
201
+ | `show <name>` | Display a stored variable |
202
+ | `exit` / `quit` | Exit the shell |
203
+
204
+ You can see all the commands available in the interactive shell by trying them directly.
205
+
206
+ **2. Direct Command Execution**
207
+
208
+ You can also execute a single ONVIF command directly. This is useful for scripting or quick checks.
209
+
210
+ **Syntax:**
211
+ ```bash
212
+ onvif <service> <method> [parameters...] -H <host> -P <port> -u <user> -p <pass>
213
+ ```
214
+
215
+ **Example:**
216
+ ```bash
217
+ # Get device capabilities
218
+ onvif devicemgmt GetCapabilities Category=All -H 192.168.1.17 -P 8000 -u admin -p admin123
219
+
220
+ # Move a PTZ camera
221
+ onvif ptz ContinuousMove ProfileToken=Profile_1 Velocity='{"PanTilt": {"x": 0.1}}' -H 192.168.1.17 -P 8000 -u admin -p admin123
222
+ ```
223
+
224
+ ### CLI Parameters
225
+
226
+ All `ONVIFClient` parameters (like `--timeout`, `--https`, `--cache`, etc.) are available as command-line arguments. Use `onvif --help` to see all available options.
227
+
154
228
  ## ONVIFClient Parameters
155
229
 
156
230
  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 +267,9 @@ The `ONVIFClient` class provides various configuration options to customize the
193
267
 
194
268
  | Parameter | Type | Required | Default | Description |
195
269
  |-----------|------|----------|---------|-------------|
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)) |
270
+ | `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)) |
271
+ | `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)) |
272
+ | `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
273
 
200
274
  </details>
201
275
 
@@ -428,53 +502,6 @@ else:
428
502
  - **GetCapabilities** is **mandatory** for all ONVIF-compliant devices, ensuring broader compatibility
429
503
  - **Default URLs** guarantee basic connectivity even with non-compliant devices
430
504
 
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
505
  > [!TIP]
479
506
  > 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
507
 
@@ -630,8 +657,8 @@ Some ONVIF services have multiple bindings in the same WSDL. These typically inc
630
657
  ## Future Improvements (Stay tuned and star ⭐ this repo)
631
658
 
632
659
  - [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.
660
+ - [x] ~~Add functionality for `ONVIFClient` to accept a custom `wsdl_dir` service.~~ ([65f2570](https://github.com/nirsimetri/onvif-python/commit/65f2570))
661
+ - [x] ~~Add `ONVIF CLI` program to interact directly with ONVIF devices via terminal.~~ ([645be01](https://github.com/nirsimetri/onvif-python/commit/645be01))
635
662
  - [ ] Add asynchronous (async/await) support for non-blocking ONVIF operations and concurrent device communication.
636
663
  - [ ] Implement structured data models for ONVIF Schemas using [xsdata](https://github.com/tefra/xsdata).
637
664
  - [ ] Integrate [xmltodict](https://github.com/martinblech/xmltodict) for simplified XML parsing and conversion.
@@ -2,9 +2,9 @@
2
2
 
3
3
  [![License](https://img.shields.io/badge/License-MIT-blue)](https://github.com/nirsimetri/onvif-python?tab=MIT-1-ov-file)
4
4
  [![DeepWiki](https://img.shields.io/badge/DeepWiki-AI%20Wiki-orange)](https://deepwiki.com/nirsimetri/onvif-python)
5
- [![Release](https://img.shields.io/badge/Release-v0.1.0-red?logo=archive)](https://github.com/nirsimetri/onvif-python/releases)
5
+ [![Release](https://img.shields.io/badge/Release-v0.1.1-red?logo=archive)](https://github.com/nirsimetri/onvif-python/releases)
6
6
  <br>
7
- [![PyPI](https://img.shields.io/badge/PyPI-0.1.0-yellow?logo=archive)](https://pypi.org/project/onvif-python/)
7
+ [![PyPI](https://img.shields.io/badge/PyPI-0.1.1-yellow?logo=archive)](https://pypi.org/project/onvif-python/)
8
8
  [![Downloads](https://img.shields.io/pypi/dm/onvif-python?label=PyPI%20Downloads)](https://clickpy.clickhouse.com/dashboard/onvif-python)
9
9
 
10
10
  **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.
@@ -28,6 +28,13 @@ This library simplifies that process by wrapping SOAP communication into a clean
28
28
  - **Companies** building video intelligence, analytics, or VMS platforms
29
29
  - **Security integrators** who need reliable ONVIF interoperability across devices
30
30
 
31
+ ## Requirements
32
+
33
+ - **Python**: 3.9 or higher
34
+ - **Dependencies**:
35
+ - [`zeep>=4.3.0`](https://github.com/mvantellingen/python-zeep) - SOAP client for ONVIF communication
36
+ - [`requests>=2.32.0`](https://github.com/psf/requests) - HTTP library for network requests
37
+
31
38
  ## Installation
32
39
 
33
40
  From official [PyPI](https://pypi.org/project/onvif-python/):
@@ -113,6 +120,73 @@ Explore more advanced usage and service-specific operations in the [`examples/`]
113
120
  > [!IMPORTANT]
114
121
  > 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.
115
122
 
123
+ ## ONVIF CLI
124
+
125
+ > [!NOTE]
126
+ > 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.0](https://github.com/nirsimetri/onvif-python/releases/tag/v0.1.1)
127
+
128
+ 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.
129
+
130
+ ### Features
131
+
132
+ - **Interactive Shell:** A user-friendly shell with tab completion, command history, and colorized output.
133
+ - **Direct Command Execution:** Run ONVIF commands directly from the terminal for scripting and automation.
134
+ - **Automatic Discovery:** Automatically detects available services on the device.
135
+ - **Connection Management:** Supports HTTP/HTTPS, custom timeouts, and SSL verification.
136
+ - **Data Management:** Store results from commands and use them as parameters in subsequent commands.
137
+ - **Cross-Platform:** Works on Windows, macOS, and Linux.
138
+
139
+ ### Usage
140
+
141
+ **1. Interactive Mode**
142
+
143
+ The interactive shell is recommended for exploration and debugging. It provides an intuitive way to navigate services, call methods, and view results.
144
+
145
+ To start the interactive shell, provide the connection details:
146
+
147
+ ```bash
148
+ onvif --host 192.168.1.17 --port 8000 --username admin --password admin123 -i
149
+ ```
150
+
151
+ If you omit the username or password, you will be prompted to enter them securely.
152
+
153
+ **Interactive Shell Commands:**
154
+ | Command | Description |
155
+ |---|---|
156
+ | `help` | Show help information |
157
+ | `ls` | List available services or methods in the current context |
158
+ | `cd <service>` | Enter a service mode (e.g., `cd devicemgmt`) |
159
+ | `up` | Go back to the root context |
160
+ | `pwd` | Show the current service context |
161
+ | `desc <method>` | Show documentation for a method |
162
+ | `store <name>` | Store the last result with a variable name |
163
+ | `show <name>` | Display a stored variable |
164
+ | `exit` / `quit` | Exit the shell |
165
+
166
+ You can see all the commands available in the interactive shell by trying them directly.
167
+
168
+ **2. Direct Command Execution**
169
+
170
+ You can also execute a single ONVIF command directly. This is useful for scripting or quick checks.
171
+
172
+ **Syntax:**
173
+ ```bash
174
+ onvif <service> <method> [parameters...] -H <host> -P <port> -u <user> -p <pass>
175
+ ```
176
+
177
+ **Example:**
178
+ ```bash
179
+ # Get device capabilities
180
+ onvif devicemgmt GetCapabilities Category=All -H 192.168.1.17 -P 8000 -u admin -p admin123
181
+
182
+ # Move a PTZ camera
183
+ onvif ptz ContinuousMove ProfileToken=Profile_1 Velocity='{"PanTilt": {"x": 0.1}}' -H 192.168.1.17 -P 8000 -u admin -p admin123
184
+ ```
185
+
186
+ ### CLI Parameters
187
+
188
+ All `ONVIFClient` parameters (like `--timeout`, `--https`, `--cache`, etc.) are available as command-line arguments. Use `onvif --help` to see all available options.
189
+
116
190
  ## ONVIFClient Parameters
117
191
 
118
192
  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:
@@ -155,9 +229,9 @@ The `ONVIFClient` class provides various configuration options to customize the
155
229
 
156
230
  | Parameter | Type | Required | Default | Description |
157
231
  |-----------|------|----------|---------|-------------|
158
- | `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)) |
159
- | `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)) |
160
- | `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)) |
232
+ | `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)) |
233
+ | `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)) |
234
+ | `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)) |
161
235
 
162
236
  </details>
163
237
 
@@ -390,53 +464,6 @@ else:
390
464
  - **GetCapabilities** is **mandatory** for all ONVIF-compliant devices, ensuring broader compatibility
391
465
  - **Default URLs** guarantee basic connectivity even with non-compliant devices
392
466
 
393
- **Get detailed service information:**
394
-
395
- If you need comprehensive service details, you can manually call `GetServices` with capabilities:
396
-
397
- ```python
398
- device = client.devicemgmt()
399
-
400
- try:
401
- # Try to get detailed service information
402
- services = device.GetServices(IncludeCapability=True)
403
- for service in services:
404
- print(f"Service: {service.Namespace}")
405
- print(f"XAddr: {service.XAddr}")
406
- if hasattr(service, 'Capabilities'):
407
- print(f"Capabilities: {service.Capabilities}")
408
- except Exception:
409
- # Fallback to GetCapabilities for legacy devices
410
- capabilities = device.GetCapabilities()
411
- print("Capabilities:", capabilities)
412
- ```
413
-
414
- **Access capabilities information:**
415
-
416
- When using `GetCapabilities` fallback, you can access capability information:
417
-
418
- ```python
419
- device = client.devicemgmt()
420
-
421
- try:
422
- # Get capabilities information from device
423
- capabilities = device.GetCapabilities()
424
-
425
- # Main services (always available)
426
- print("Media XAddr:", getattr(capabilities.Media, 'XAddr', 'Not available'))
427
- print("PTZ XAddr:", getattr(capabilities.PTZ, 'XAddr', 'Not available'))
428
-
429
- # Extension services (device-dependent)
430
- ext = getattr(capabilities, 'Extension', None)
431
- if ext:
432
- print("DeviceIO XAddr:", getattr(ext.DeviceIO, 'XAddr', 'Not available'))
433
- print("Recording XAddr:", getattr(ext.Recording, 'XAddr', 'Not available'))
434
- print("Search XAddr:", getattr(ext.Search, 'XAddr', 'Not available'))
435
- print("Replay XAddr:", getattr(ext.Replay, 'XAddr', 'Not available'))
436
- except Exception as e:
437
- print(f"Error getting capabilities: {e}")
438
- ```
439
-
440
467
  > [!TIP]
441
468
  > 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.
442
469
 
@@ -592,8 +619,8 @@ Some ONVIF services have multiple bindings in the same WSDL. These typically inc
592
619
  ## Future Improvements (Stay tuned and star ⭐ this repo)
593
620
 
594
621
  - [x] ~~Add debugging mode with raw xml on SOAP requests and responses.~~ ([c258162](https://github.com/nirsimetri/onvif-python/commit/c258162))
595
- - [x] ~~Add functionality for `ONVIFClient` to accept a custom `wsdl_dir` service.~~ ([65f2570](https://github.com/nirsimetri/onvif-python/commit/65f257092e4c9daa23dd0d00825ed38a45d23b70))
596
- - [ ] Add `ONVIF CLI` program to interact directly with ONVIF devices via terminal.
622
+ - [x] ~~Add functionality for `ONVIFClient` to accept a custom `wsdl_dir` service.~~ ([65f2570](https://github.com/nirsimetri/onvif-python/commit/65f2570))
623
+ - [x] ~~Add `ONVIF CLI` program to interact directly with ONVIF devices via terminal.~~ ([645be01](https://github.com/nirsimetri/onvif-python/commit/645be01))
597
624
  - [ ] Add asynchronous (async/await) support for non-blocking ONVIF operations and concurrent device communication.
598
625
  - [ ] Implement structured data models for ONVIF Schemas using [xsdata](https://github.com/tefra/xsdata).
599
626
  - [ ] Integrate [xmltodict](https://github.com/martinblech/xmltodict) for simplified XML parsing and conversion.
@@ -4,6 +4,14 @@ from .client import ONVIFClient
4
4
  from .operator import ONVIFOperator, CacheMode
5
5
  from .utils import ONVIFWSDL, ONVIFOperationException, ONVIFErrorHandler, ZeepPatcher
6
6
 
7
+ # CLI module is optional - import only if needed
8
+ try:
9
+ from .cli import main as ONVIFCLI
10
+
11
+ CLI_AVAILABLE = True
12
+ except ImportError:
13
+ CLI_AVAILABLE = False
14
+
7
15
  __all__ = [
8
16
  "ONVIFClient",
9
17
  "ONVIFOperator",
@@ -13,3 +21,6 @@ __all__ = [
13
21
  "ONVIFErrorHandler",
14
22
  "ZeepPatcher",
15
23
  ]
24
+
25
+ if CLI_AVAILABLE:
26
+ __all__.append("ONVIFCLI")
@@ -0,0 +1,5 @@
1
+ # onvif/cli/__init__.py
2
+
3
+ from .main import main
4
+
5
+ __all__ = ["main"]
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env python3
2
+ # onvif/cli/__main__.py
3
+
4
+ """
5
+ ONVIF CLI entry point for python -m onvif.cli
6
+ """
7
+
8
+ from .main import main
9
+
10
+ if __name__ == "__main__":
11
+ main()