onvif-python 0.0.6__tar.gz → 0.0.8__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 (123) hide show
  1. {onvif_python-0.0.6/onvif_python.egg-info → onvif_python-0.0.8}/PKG-INFO +209 -10
  2. {onvif_python-0.0.6 → onvif_python-0.0.8}/README.md +206 -7
  3. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/__init__.py +3 -5
  4. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/client.py +3 -8
  5. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/operator.py +3 -4
  6. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/__init__.py +2 -0
  7. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/imaging.py +3 -1
  8. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/provisioning.py +1 -1
  9. onvif_python-0.0.8/onvif/utils/__init__.py +16 -0
  10. onvif_python-0.0.8/onvif/utils/error_handlers.py +76 -0
  11. onvif_python-0.0.8/onvif/utils/exceptions.py +69 -0
  12. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/utils/xml_capture.py +79 -44
  13. onvif_python-0.0.8/onvif/utils/zeep.py +540 -0
  14. {onvif_python-0.0.6 → onvif_python-0.0.8/onvif_python.egg-info}/PKG-INFO +209 -10
  15. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif_python.egg-info/SOURCES.txt +1 -0
  16. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif_python.egg-info/requires.txt +2 -2
  17. {onvif_python-0.0.6 → onvif_python-0.0.8}/pyproject.toml +13 -4
  18. onvif_python-0.0.6/onvif/utils/__init__.py +0 -5
  19. onvif_python-0.0.6/onvif/utils/exceptions.py +0 -33
  20. onvif_python-0.0.6/onvif/utils/zeep.py +0 -286
  21. {onvif_python-0.0.6 → onvif_python-0.0.8}/LICENSE.md +0 -0
  22. {onvif_python-0.0.6 → onvif_python-0.0.8}/MANIFEST.in +0 -0
  23. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/accesscontrol.py +0 -0
  24. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/accessrules.py +0 -0
  25. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/actionengine.py +0 -0
  26. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/analytics/analytics.py +0 -0
  27. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/analytics/ruleengine.py +0 -0
  28. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/analyticsdevice.py +0 -0
  29. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/appmgmt.py +0 -0
  30. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/authenticationbehavior.py +0 -0
  31. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/credential.py +0 -0
  32. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/deviceio.py +0 -0
  33. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/devicemgmt.py +0 -0
  34. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/display.py +0 -0
  35. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/doorcontrol.py +0 -0
  36. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/events/events.py +0 -0
  37. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/events/notification.py +0 -0
  38. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/events/pullpoint.py +0 -0
  39. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/events/subscription.py +0 -0
  40. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/media.py +0 -0
  41. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/media2.py +0 -0
  42. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/ptz.py +0 -0
  43. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/receiver.py +0 -0
  44. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/recording.py +0 -0
  45. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/replay.py +0 -0
  46. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/schedule.py +0 -0
  47. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/search.py +0 -0
  48. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/security/advancedsecurity.py +0 -0
  49. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/security/authorizationserver.py +0 -0
  50. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/security/dot1x.py +0 -0
  51. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/security/jwt.py +0 -0
  52. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/security/keystore.py +0 -0
  53. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/security/mediasigning.py +0 -0
  54. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/security/tlsserver.py +0 -0
  55. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/thermal.py +0 -0
  56. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/services/uplink.py +0 -0
  57. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/utils/wsdl.py +0 -0
  58. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/accesscontrol/wsdl/index.html +0 -0
  59. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/accessrules/wsdl/accessrules.wsdl +0 -0
  60. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/accessrules/wsdl/index.html +0 -0
  61. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/actionengine.wsdl +0 -0
  62. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/advancedsecurity/wsdl/advancedsecurity.wsdl +0 -0
  63. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/advancedsecurity/wsdl/index.html +0 -0
  64. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/analyticsdevice.wsdl +0 -0
  65. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/appmgmt/wsdl/appmgmt.wsdl +0 -0
  66. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/appmgmt/wsdl/index.html +0 -0
  67. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/authenticationbehavior/wsdl/authenticationbehavior.wsdl +0 -0
  68. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/authenticationbehavior/wsdl/index.html +0 -0
  69. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/credential/wsdl/credential.wsdl +0 -0
  70. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/credential/wsdl/index.html +0 -0
  71. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/device/wsdl/devicemgmt.wsdl +0 -0
  72. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/deviceio.wsdl +0 -0
  73. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/display/display.wsdl +0 -0
  74. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/display/wsdl/index.htm +0 -0
  75. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/display.wsdl +0 -0
  76. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/doorcontrol/wsdl/index.html +0 -0
  77. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/events/wsdl/bw-2-vs-mod.wsdl +0 -0
  78. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/events/wsdl/event-vs.wsdl +0 -0
  79. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/events/wsdl/event.wsdl +0 -0
  80. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/events/wsdl/index.html +0 -0
  81. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/federatedsearch.wsdl +0 -0
  82. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/media/wsdl/media.wsdl +0 -0
  83. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/pacs/accesscontrol.wsdl +0 -0
  84. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/pacs/doorcontrol.wsdl +0 -0
  85. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/pacs/types.xsd +0 -0
  86. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/provisioning/wsdl/provisioning.wsdl +0 -0
  87. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/receiver.wsdl +0 -0
  88. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/recording.wsdl +0 -0
  89. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/replay.wsdl +0 -0
  90. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/schedule/wsdl/index.html +0 -0
  91. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/schedule/wsdl/schedule.wsdl +0 -0
  92. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/schema/common.xsd +0 -0
  93. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/schema/metadatastream.xsd +0 -0
  94. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/schema/onvif.xsd +0 -0
  95. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/search.wsdl +0 -0
  96. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/thermal/wsdl/index.html +0 -0
  97. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/thermal/wsdl/thermal.wsdl +0 -0
  98. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/topics/topicns.xml +0 -0
  99. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/uplink/wsdl/index.html +0 -0
  100. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver10/uplink/wsdl/uplink.wsdl +0 -0
  101. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver20/analytics/humanbody.xsd +0 -0
  102. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver20/analytics/humanface.xsd +0 -0
  103. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver20/analytics/index.html +0 -0
  104. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver20/analytics/radiometry.xsd +0 -0
  105. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver20/analytics/rules.xsd +0 -0
  106. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver20/analytics/wsdl/analytics.wsdl +0 -0
  107. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver20/analytics/wsdl/index.html +0 -0
  108. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver20/imaging/wsdl/imaging.wsdl +0 -0
  109. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver20/media/wsdl/index.html +0 -0
  110. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver20/media/wsdl/media.wsdl +0 -0
  111. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver20/ptz/wsdl/ptz.wsdl +0 -0
  112. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver20/util/federated_search_documentation.html +0 -0
  113. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver20/util/fedsearch-docu-viewer.xsl +0 -0
  114. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver20/util/onvif-wsdl-viewer.xsl +0 -0
  115. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif/wsdl/ver20/util/operationIndex.html +0 -0
  116. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif_python.egg-info/dependency_links.txt +0 -0
  117. {onvif_python-0.0.6 → onvif_python-0.0.8}/onvif_python.egg-info/top_level.txt +0 -0
  118. {onvif_python-0.0.6 → onvif_python-0.0.8}/setup.cfg +0 -0
  119. {onvif_python-0.0.6 → onvif_python-0.0.8}/setup.py +0 -0
  120. {onvif_python-0.0.6 → onvif_python-0.0.8}/tests/test_client.py +0 -0
  121. {onvif_python-0.0.6 → onvif_python-0.0.8}/tests/test_core.py +0 -0
  122. {onvif_python-0.0.6 → onvif_python-0.0.8}/tests/test_exceptions.py +0 -0
  123. {onvif_python-0.0.6 → onvif_python-0.0.8}/tests/test_wsdl_map.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: onvif-python
3
- Version: 0.0.6
3
+ Version: 0.0.8
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
@@ -31,8 +31,8 @@ Classifier: Natural Language :: Indonesian
31
31
  Requires-Python: >=3.9
32
32
  Description-Content-Type: text/markdown
33
33
  License-File: LICENSE.md
34
- Requires-Dist: zeep>=4.2.1
35
- Requires-Dist: requests>=2.28.0
34
+ Requires-Dist: zeep>=4.3.0
35
+ Requires-Dist: requests>=2.32.0
36
36
  Provides-Extra: dev
37
37
  Requires-Dist: pytest>=7.0; extra == "dev"
38
38
  Requires-Dist: black; extra == "dev"
@@ -43,14 +43,11 @@ Dynamic: license-file
43
43
 
44
44
  [![License](https://img.shields.io/badge/License-MIT-blue)](https://github.com/nirsimetri/onvif-python?tab=MIT-1-ov-file)
45
45
  [![DeepWiki](https://img.shields.io/badge/DeepWiki-AI%20Wiki-orange)](https://deepwiki.com/nirsimetri/onvif-python)
46
- [![Release](https://img.shields.io/badge/Release-v0.0.6-red?logo=archive)](https://github.com/nirsimetri/onvif-python/releases)
46
+ [![Release](https://img.shields.io/badge/Release-v0.0.8-red?logo=archive)](https://github.com/nirsimetri/onvif-python/releases)
47
47
  <br>
48
- [![PyPI](https://img.shields.io/badge/PyPI-0.0.6-yellow?logo=archive)](https://pypi.org/project/onvif-python/)
48
+ [![PyPI](https://img.shields.io/badge/PyPI-0.0.8-yellow?logo=archive)](https://pypi.org/project/onvif-python/)
49
49
  [![Downloads](https://img.shields.io/pypi/dm/onvif-python?label=PyPI%20Downloads)](https://clickpy.clickhouse.com/dashboard/onvif-python)
50
50
 
51
- Are you having trouble finding a Python ONVIF library that supports your device?
52
- Are you confused about the compatibility of the various ONVIF versions, which are updated every six months?
53
-
54
51
  **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.
55
52
 
56
53
  **[ONVIF](https://www.onvif.org) (Open Network Video Interface Forum)** is a global standard for the interface of IP-based physical security products, including network cameras, video recorders, and related systems.
@@ -150,6 +147,210 @@ Explore more advanced usage and service-specific operations in the [`examples/`]
150
147
  > [!IMPORTANT]
151
148
  > 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.
152
149
 
150
+ ## ONVIFClient Parameters
151
+
152
+ 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:
153
+
154
+
155
+ <details>
156
+ <summary><b>Basic Parameters</b></summary>
157
+
158
+ | Parameter | Type | Required | Default | Description |
159
+ |-----------|------|----------|---------|-------------|
160
+ | `host` | `str` | ✅ Yes | - | IP address or hostname of the ONVIF device (e.g., `"192.168.1.17"`) |
161
+ | `port` | `int` | ✅ Yes | - | Port number for ONVIF service (common ports: `80`, `8000`, `8080`) |
162
+ | `username` | `str` | ✅ Yes | - | Username for device authentication (use digest authentication) |
163
+ | `password` | `str` | ✅ Yes | - | Password for device authentication |
164
+
165
+ </details>
166
+
167
+ <details>
168
+ <summary><b>Connection Parameters</b></summary>
169
+
170
+ | Parameter | Type | Required | Default | Description |
171
+ |-----------|------|----------|---------|-------------|
172
+ | `timeout` | `int` | ❌ No | `10` | Connection timeout in seconds for SOAP requests |
173
+ | `use_https` | `bool` | ❌ No | `False` | Use HTTPS instead of HTTP for secure communication |
174
+ | `verify_ssl` | `bool` | ❌ No | `True` | Verify SSL certificates when using HTTPS (set to `False` for self-signed certificates) |
175
+
176
+ </details>
177
+
178
+ <details>
179
+ <summary><b>Caching Parameters</b></summary>
180
+
181
+ | Parameter | Type | Required | Default | Description |
182
+ |-----------|------|----------|---------|-------------|
183
+ | `cache` | `CacheMode` | ❌ No | `CacheMode.ALL` | WSDL caching strategy (see [Cache Modes](#cache-modes) below) |
184
+
185
+ </details>
186
+
187
+ <details>
188
+ <summary><b>Feature Parameters</b></summary>
189
+
190
+ | Parameter | Type | Required | Default | Description |
191
+ |-----------|------|----------|---------|-------------|
192
+ | `apply_patch` | `bool` | ❌ No | `True` | Enable zeep patching for better `xsd:any` field parsing and automatic flattening |
193
+ | `capture_xml` | `bool` | ❌ No | `False` | Enable XML capture plugin for debugging SOAP requests/responses |
194
+
195
+ </details>
196
+
197
+ <details>
198
+ <summary><b>Cache Modes</b></summary>
199
+
200
+ The library provides four caching strategies via the `CacheMode` enum:
201
+
202
+ | Mode | Description | Best For | Startup Speed | Disk Usage | Memory Usage |
203
+ |------|-------------|----------|---------------|------------|--------------|
204
+ | `CacheMode.ALL` | In-memory + disk cache (SQLite) | Production servers, multi-device apps | Fast | High | High |
205
+ | `CacheMode.DB` | Disk cache only (SQLite) | Batch jobs, CLI tools | Medium | Medium | Low |
206
+ | `CacheMode.MEM` | In-memory cache only | Short-lived scripts, demos | Medium | None | Medium |
207
+ | `CacheMode.NONE` | No caching | Testing, debugging | Slow | None | Low |
208
+
209
+ **Recommendation:** Use `CacheMode.ALL` (default) for production applications to maximize performance.
210
+
211
+ </details>
212
+
213
+ <details>
214
+ <summary><b>Usage Examples</b></summary>
215
+
216
+ **Basic Connection:**
217
+ ```python
218
+ from onvif import ONVIFClient
219
+
220
+ # Minimal configuration
221
+ client = ONVIFClient("192.168.1.17", 80, "admin", "password")
222
+ ```
223
+
224
+ **Secure Connection (HTTPS):**
225
+ ```python
226
+ from onvif import ONVIFClient
227
+
228
+ # Connect via HTTPS with custom timeout
229
+ client = ONVIFClient(
230
+ "your-cctv-node.viewplexus.com",
231
+ 443, # HTTPS port
232
+ "admin",
233
+ "password",
234
+ timeout=30,
235
+ use_https=True
236
+ )
237
+ ```
238
+
239
+ **Performance Optimized (Memory Cache):**
240
+ ```python
241
+ from onvif import ONVIFClient, CacheMode
242
+
243
+ # Use memory-only cache for quick scripts
244
+ client = ONVIFClient(
245
+ "192.168.1.17",
246
+ 80,
247
+ "admin",
248
+ "password",
249
+ cache=CacheMode.MEM
250
+ )
251
+ ```
252
+
253
+ **No Caching and No Zeep Patching (Testing):**
254
+ ```python
255
+ from onvif import ONVIFClient, CacheMode
256
+
257
+ # Disable all caching for testing
258
+ client = ONVIFClient(
259
+ "192.168.1.17",
260
+ 80,
261
+ "admin",
262
+ "password",
263
+ cache=CacheMode.NONE,
264
+ apply_patch=False # Use original zeep behavior
265
+ )
266
+ ```
267
+
268
+ **Debugging Mode (XML Capture):**
269
+ ```python
270
+ from onvif import ONVIFClient
271
+
272
+ # Enable XML capture for debugging
273
+ client = ONVIFClient(
274
+ "192.168.1.17",
275
+ 80,
276
+ "admin",
277
+ "password",
278
+ capture_xml=True # Captures all SOAP requests/responses
279
+ )
280
+
281
+ # Make some ONVIF calls
282
+ device = client.devicemgmt()
283
+ info = device.GetDeviceInformation()
284
+ services = device.GetCapabilities()
285
+
286
+ # Access the XML capture plugin
287
+ if client.xml_plugin:
288
+ # Get last captured request/response
289
+ print("Last Request XML:")
290
+ print(client.xml_plugin.last_sent_xml)
291
+
292
+ print("\nLast Response XML:")
293
+ print(client.xml_plugin.last_received_xml)
294
+
295
+ print(f"\nLast Operation: {client.xml_plugin.last_operation}")
296
+
297
+ # Get complete history of all requests/responses
298
+ print(f"\nTotal captured operations: {len(client.xml_plugin.history)}")
299
+ for item in client.xml_plugin.history:
300
+ print(f" - {item['operation']} ({item['type']})")
301
+
302
+ # Save captured XML to files
303
+ client.xml_plugin.save_to_file(
304
+ request_file="last_request.xml",
305
+ response_file="last_response.xml"
306
+ )
307
+
308
+ # Clear history when done
309
+ client.xml_plugin.clear_history()
310
+ ```
311
+
312
+ > **XML Capture Plugin Methods:**
313
+ > - `last_sent_xml` - Get the last SOAP request XML
314
+ > - `last_received_xml` - Get the last SOAP response XML
315
+ > - `last_operation` - Get the name of the last operation
316
+ > - `history` - List of all captured requests/responses with metadata
317
+ > - `get_last_request()` - Method to get last request
318
+ > - `get_last_response()` - Method to get last response
319
+ > - `get_history()` - Method to get all history
320
+ > - `save_to_file(request_file, response_file)` - Save XML to files
321
+ > - `clear_history()` - Clear captured history
322
+
323
+ </details>
324
+
325
+ <details>
326
+ <summary><b>Production Configuration</b></summary>
327
+
328
+ ```python
329
+ from onvif import ONVIFClient, CacheMode
330
+
331
+ # Recommended production settings
332
+ client = ONVIFClient(
333
+ host="your-cctv-node.viewplexus.com",
334
+ port=443,
335
+ username="admin",
336
+ password="secure_password",
337
+ timeout=15,
338
+ cache=CacheMode.ALL, # Maximum performance (default)
339
+ use_https=True, # Secure communication
340
+ verify_ssl=True, # Verify certificates (default)
341
+ apply_patch=True, # Enhanced parsing (default)
342
+ capture_xml=False # Disable debug mode (default)
343
+ )
344
+ ```
345
+ </details>
346
+
347
+ ### Notes
348
+
349
+ - **Authentication:** This library uses **WS-UsernameToken with Digest** authentication by default, which is the standard for ONVIF devices.
350
+ - **Patching:** The `apply_patch=True` (default) enables custom zeep patching that improves `xsd:any` field parsing. This is recommended for better compatibility with ONVIF responses.
351
+ - **XML Capture:** Only use `capture_xml=True` during development/debugging as it increases memory usage and may expose sensitive data in logs.
352
+ - **Cache Location:** Disk cache (when using `CacheMode.DB` or `CacheMode.ALL`) is stored in `~/.onvif-python/onvif_zeep_cache.sqlite`.
353
+
153
354
  ## Service Discovery: Understanding Device Capabilities
154
355
 
155
356
  > [!WARNING]
@@ -413,8 +614,6 @@ This project is an **independent open-source implementation** of the [ONVIF](htt
413
614
 
414
615
  If you require certified ONVIF-compliant devices or clients, please refer to the official [ONVIF conformant product list](https://www.onvif.org/conformant-products/). For authoritative reference and the latest official ONVIF specifications, please consult the [ONVIF Official Specifications](https://www.onvif.org/profiles/specifications/specification-history/).
415
616
 
416
- Use of this library is at your own risk. The authors and contributors assume no liability for any damages, direct or indirect, arising from its use.
417
-
418
617
  ## License
419
618
 
420
619
  This project is licensed under the MIT License. See [LICENSE](./LICENSE.md) for details.
@@ -2,14 +2,11 @@
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.0.6-red?logo=archive)](https://github.com/nirsimetri/onvif-python/releases)
5
+ [![Release](https://img.shields.io/badge/Release-v0.0.8-red?logo=archive)](https://github.com/nirsimetri/onvif-python/releases)
6
6
  <br>
7
- [![PyPI](https://img.shields.io/badge/PyPI-0.0.6-yellow?logo=archive)](https://pypi.org/project/onvif-python/)
7
+ [![PyPI](https://img.shields.io/badge/PyPI-0.0.8-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
- Are you having trouble finding a Python ONVIF library that supports your device?
11
- Are you confused about the compatibility of the various ONVIF versions, which are updated every six months?
12
-
13
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.
14
11
 
15
12
  **[ONVIF](https://www.onvif.org) (Open Network Video Interface Forum)** is a global standard for the interface of IP-based physical security products, including network cameras, video recorders, and related systems.
@@ -109,6 +106,210 @@ Explore more advanced usage and service-specific operations in the [`examples/`]
109
106
  > [!IMPORTANT]
110
107
  > 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.
111
108
 
109
+ ## ONVIFClient Parameters
110
+
111
+ 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:
112
+
113
+
114
+ <details>
115
+ <summary><b>Basic Parameters</b></summary>
116
+
117
+ | Parameter | Type | Required | Default | Description |
118
+ |-----------|------|----------|---------|-------------|
119
+ | `host` | `str` | ✅ Yes | - | IP address or hostname of the ONVIF device (e.g., `"192.168.1.17"`) |
120
+ | `port` | `int` | ✅ Yes | - | Port number for ONVIF service (common ports: `80`, `8000`, `8080`) |
121
+ | `username` | `str` | ✅ Yes | - | Username for device authentication (use digest authentication) |
122
+ | `password` | `str` | ✅ Yes | - | Password for device authentication |
123
+
124
+ </details>
125
+
126
+ <details>
127
+ <summary><b>Connection Parameters</b></summary>
128
+
129
+ | Parameter | Type | Required | Default | Description |
130
+ |-----------|------|----------|---------|-------------|
131
+ | `timeout` | `int` | ❌ No | `10` | Connection timeout in seconds for SOAP requests |
132
+ | `use_https` | `bool` | ❌ No | `False` | Use HTTPS instead of HTTP for secure communication |
133
+ | `verify_ssl` | `bool` | ❌ No | `True` | Verify SSL certificates when using HTTPS (set to `False` for self-signed certificates) |
134
+
135
+ </details>
136
+
137
+ <details>
138
+ <summary><b>Caching Parameters</b></summary>
139
+
140
+ | Parameter | Type | Required | Default | Description |
141
+ |-----------|------|----------|---------|-------------|
142
+ | `cache` | `CacheMode` | ❌ No | `CacheMode.ALL` | WSDL caching strategy (see [Cache Modes](#cache-modes) below) |
143
+
144
+ </details>
145
+
146
+ <details>
147
+ <summary><b>Feature Parameters</b></summary>
148
+
149
+ | Parameter | Type | Required | Default | Description |
150
+ |-----------|------|----------|---------|-------------|
151
+ | `apply_patch` | `bool` | ❌ No | `True` | Enable zeep patching for better `xsd:any` field parsing and automatic flattening |
152
+ | `capture_xml` | `bool` | ❌ No | `False` | Enable XML capture plugin for debugging SOAP requests/responses |
153
+
154
+ </details>
155
+
156
+ <details>
157
+ <summary><b>Cache Modes</b></summary>
158
+
159
+ The library provides four caching strategies via the `CacheMode` enum:
160
+
161
+ | Mode | Description | Best For | Startup Speed | Disk Usage | Memory Usage |
162
+ |------|-------------|----------|---------------|------------|--------------|
163
+ | `CacheMode.ALL` | In-memory + disk cache (SQLite) | Production servers, multi-device apps | Fast | High | High |
164
+ | `CacheMode.DB` | Disk cache only (SQLite) | Batch jobs, CLI tools | Medium | Medium | Low |
165
+ | `CacheMode.MEM` | In-memory cache only | Short-lived scripts, demos | Medium | None | Medium |
166
+ | `CacheMode.NONE` | No caching | Testing, debugging | Slow | None | Low |
167
+
168
+ **Recommendation:** Use `CacheMode.ALL` (default) for production applications to maximize performance.
169
+
170
+ </details>
171
+
172
+ <details>
173
+ <summary><b>Usage Examples</b></summary>
174
+
175
+ **Basic Connection:**
176
+ ```python
177
+ from onvif import ONVIFClient
178
+
179
+ # Minimal configuration
180
+ client = ONVIFClient("192.168.1.17", 80, "admin", "password")
181
+ ```
182
+
183
+ **Secure Connection (HTTPS):**
184
+ ```python
185
+ from onvif import ONVIFClient
186
+
187
+ # Connect via HTTPS with custom timeout
188
+ client = ONVIFClient(
189
+ "your-cctv-node.viewplexus.com",
190
+ 443, # HTTPS port
191
+ "admin",
192
+ "password",
193
+ timeout=30,
194
+ use_https=True
195
+ )
196
+ ```
197
+
198
+ **Performance Optimized (Memory Cache):**
199
+ ```python
200
+ from onvif import ONVIFClient, CacheMode
201
+
202
+ # Use memory-only cache for quick scripts
203
+ client = ONVIFClient(
204
+ "192.168.1.17",
205
+ 80,
206
+ "admin",
207
+ "password",
208
+ cache=CacheMode.MEM
209
+ )
210
+ ```
211
+
212
+ **No Caching and No Zeep Patching (Testing):**
213
+ ```python
214
+ from onvif import ONVIFClient, CacheMode
215
+
216
+ # Disable all caching for testing
217
+ client = ONVIFClient(
218
+ "192.168.1.17",
219
+ 80,
220
+ "admin",
221
+ "password",
222
+ cache=CacheMode.NONE,
223
+ apply_patch=False # Use original zeep behavior
224
+ )
225
+ ```
226
+
227
+ **Debugging Mode (XML Capture):**
228
+ ```python
229
+ from onvif import ONVIFClient
230
+
231
+ # Enable XML capture for debugging
232
+ client = ONVIFClient(
233
+ "192.168.1.17",
234
+ 80,
235
+ "admin",
236
+ "password",
237
+ capture_xml=True # Captures all SOAP requests/responses
238
+ )
239
+
240
+ # Make some ONVIF calls
241
+ device = client.devicemgmt()
242
+ info = device.GetDeviceInformation()
243
+ services = device.GetCapabilities()
244
+
245
+ # Access the XML capture plugin
246
+ if client.xml_plugin:
247
+ # Get last captured request/response
248
+ print("Last Request XML:")
249
+ print(client.xml_plugin.last_sent_xml)
250
+
251
+ print("\nLast Response XML:")
252
+ print(client.xml_plugin.last_received_xml)
253
+
254
+ print(f"\nLast Operation: {client.xml_plugin.last_operation}")
255
+
256
+ # Get complete history of all requests/responses
257
+ print(f"\nTotal captured operations: {len(client.xml_plugin.history)}")
258
+ for item in client.xml_plugin.history:
259
+ print(f" - {item['operation']} ({item['type']})")
260
+
261
+ # Save captured XML to files
262
+ client.xml_plugin.save_to_file(
263
+ request_file="last_request.xml",
264
+ response_file="last_response.xml"
265
+ )
266
+
267
+ # Clear history when done
268
+ client.xml_plugin.clear_history()
269
+ ```
270
+
271
+ > **XML Capture Plugin Methods:**
272
+ > - `last_sent_xml` - Get the last SOAP request XML
273
+ > - `last_received_xml` - Get the last SOAP response XML
274
+ > - `last_operation` - Get the name of the last operation
275
+ > - `history` - List of all captured requests/responses with metadata
276
+ > - `get_last_request()` - Method to get last request
277
+ > - `get_last_response()` - Method to get last response
278
+ > - `get_history()` - Method to get all history
279
+ > - `save_to_file(request_file, response_file)` - Save XML to files
280
+ > - `clear_history()` - Clear captured history
281
+
282
+ </details>
283
+
284
+ <details>
285
+ <summary><b>Production Configuration</b></summary>
286
+
287
+ ```python
288
+ from onvif import ONVIFClient, CacheMode
289
+
290
+ # Recommended production settings
291
+ client = ONVIFClient(
292
+ host="your-cctv-node.viewplexus.com",
293
+ port=443,
294
+ username="admin",
295
+ password="secure_password",
296
+ timeout=15,
297
+ cache=CacheMode.ALL, # Maximum performance (default)
298
+ use_https=True, # Secure communication
299
+ verify_ssl=True, # Verify certificates (default)
300
+ apply_patch=True, # Enhanced parsing (default)
301
+ capture_xml=False # Disable debug mode (default)
302
+ )
303
+ ```
304
+ </details>
305
+
306
+ ### Notes
307
+
308
+ - **Authentication:** This library uses **WS-UsernameToken with Digest** authentication by default, which is the standard for ONVIF devices.
309
+ - **Patching:** The `apply_patch=True` (default) enables custom zeep patching that improves `xsd:any` field parsing. This is recommended for better compatibility with ONVIF responses.
310
+ - **XML Capture:** Only use `capture_xml=True` during development/debugging as it increases memory usage and may expose sensitive data in logs.
311
+ - **Cache Location:** Disk cache (when using `CacheMode.DB` or `CacheMode.ALL`) is stored in `~/.onvif-python/onvif_zeep_cache.sqlite`.
312
+
112
313
  ## Service Discovery: Understanding Device Capabilities
113
314
 
114
315
  > [!WARNING]
@@ -372,8 +573,6 @@ This project is an **independent open-source implementation** of the [ONVIF](htt
372
573
 
373
574
  If you require certified ONVIF-compliant devices or clients, please refer to the official [ONVIF conformant product list](https://www.onvif.org/conformant-products/). For authoritative reference and the latest official ONVIF specifications, please consult the [ONVIF Official Specifications](https://www.onvif.org/profiles/specifications/specification-history/).
374
575
 
375
- Use of this library is at your own risk. The authors and contributors assume no liability for any damages, direct or indirect, arising from its use.
376
-
377
576
  ## License
378
577
 
379
578
  This project is licensed under the MIT License. See [LICENSE](./LICENSE.md) for details.
@@ -2,8 +2,7 @@
2
2
 
3
3
  from .client import ONVIFClient
4
4
  from .operator import ONVIFOperator, CacheMode
5
- from .utils import ONVIFWSDL, ONVIFOperationException
6
- from .utils.zeep import apply_patch, remove_patch, is_patched
5
+ from .utils import ONVIFWSDL, ONVIFOperationException, ONVIFErrorHandler, ZeepPatcher
7
6
 
8
7
  __all__ = [
9
8
  "ONVIFClient",
@@ -11,7 +10,6 @@ __all__ = [
11
10
  "CacheMode",
12
11
  "ONVIFWSDL",
13
12
  "ONVIFOperationException",
14
- "apply_patch",
15
- "remove_patch",
16
- "is_patched",
13
+ "ONVIFErrorHandler",
14
+ "ZeepPatcher",
17
15
  ]
@@ -41,12 +41,7 @@ from .services import (
41
41
  MediaSigning,
42
42
  )
43
43
  from .operator import CacheMode
44
- from .utils.zeep import (
45
- apply_patch as _apply_zeep_patch,
46
- remove_patch as _remove_zeep_patch,
47
- )
48
- from .utils.wsdl import ONVIFWSDL
49
- from .utils.xml_capture import XMLCapturePlugin
44
+ from .utils import ONVIFWSDL, ZeepPatcher, XMLCapturePlugin
50
45
 
51
46
 
52
47
  class ONVIFClient:
@@ -67,9 +62,9 @@ class ONVIFClient:
67
62
 
68
63
  # Apply or remove zeep patch based on user preference
69
64
  if apply_patch:
70
- _apply_zeep_patch()
65
+ ZeepPatcher.apply_patch()
71
66
  else:
72
- _remove_zeep_patch()
67
+ ZeepPatcher.remove_patch()
73
68
 
74
69
  # Initialize XML capture plugin if requested
75
70
  self.xml_plugin = None
@@ -10,8 +10,7 @@ from zeep.cache import SqliteCache
10
10
  from zeep.exceptions import Fault
11
11
  from zeep.wsse.username import UsernameToken
12
12
 
13
- from .utils import ONVIFOperationException
14
- from .utils.zeep import flatten_xsd_any_fields
13
+ from .utils import ONVIFOperationException, ZeepPatcher
15
14
 
16
15
 
17
16
  class CacheMode(Enum):
@@ -117,7 +116,7 @@ class ONVIFOperator:
117
116
  raise ValueError("Bindings must be set according to the WSDL service")
118
117
 
119
118
  self.service = self.client.create_service(binding, self.address)
120
- logging.debug(f"ONVIFCore initialized {binding} at {self.address}")
119
+ # logging.debug(f"ONVIFOperator initialized {binding} at {self.address}")
121
120
 
122
121
  def call(self, method: str, *args, **kwargs):
123
122
  try:
@@ -129,7 +128,7 @@ class ONVIFOperator:
129
128
  result = func(*args, **kwargs)
130
129
  # Post-process to flatten xsd:any fields if enabled (> v0.0.4 patch)
131
130
  if self.apply_flatten:
132
- return flatten_xsd_any_fields(result)
131
+ return ZeepPatcher.flatten_xsd_any_fields(result)
133
132
  return result
134
133
  except Fault as e:
135
134
  # logging.error(f"SOAP Fault in {method}: {e}")
@@ -1,3 +1,5 @@
1
+ # onvif/services/__init__.py
2
+
1
3
  from .devicemgmt import Device
2
4
  from .events.events import Events
3
5
  from .events.pullpoint import PullPoint
@@ -28,7 +28,9 @@ class Imaging:
28
28
  "GetImagingSettings", VideoSourceToken=VideoSourceToken
29
29
  )
30
30
 
31
- def SetImagingSettings(self, VideoSourceToken, ImagingSettings, ForcePersistence=None):
31
+ def SetImagingSettings(
32
+ self, VideoSourceToken, ImagingSettings, ForcePersistence=None
33
+ ):
32
34
  return self.operator.call(
33
35
  "SetImagingSettings",
34
36
  VideoSourceToken=VideoSourceToken,
@@ -10,7 +10,7 @@ class Provisioning:
10
10
  # - ONVIF Release 16.12 (December 2016) Release Notes
11
11
  # - ProvisioningBinding (ver10/provisioning/wsdl/provisioning.wsdl)
12
12
  # - Operations: https://developer.onvif.org/pub/specs/branches/development/wsdl/ver10/provisioning/wsdl/provisioning.wsdl
13
-
13
+
14
14
  definition = ONVIFWSDL.get_definition("provisioning")
15
15
  self.operator = ONVIFOperator(
16
16
  definition["path"],
@@ -0,0 +1,16 @@
1
+ # onvif/utils/__init__.py
2
+
3
+ from .wsdl import ONVIFWSDL
4
+ from .exceptions import ONVIFOperationException
5
+ from .zeep import ZeepPatcher
6
+ from .xml_capture import XMLCapturePlugin
7
+ from .error_handlers import ONVIFErrorHandler
8
+
9
+
10
+ __all__ = [
11
+ "ONVIFWSDL",
12
+ "ONVIFOperationException",
13
+ "ZeepPatcher",
14
+ "XMLCapturePlugin",
15
+ "ONVIFErrorHandler",
16
+ ]