onvif-python 0.0.1__tar.gz → 0.0.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 (118) hide show
  1. {onvif_python-0.0.1/onvif_python.egg-info → onvif_python-0.0.2}/PKG-INFO +3 -6
  2. {onvif_python-0.0.1 → onvif_python-0.0.2}/README.md +2 -5
  3. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/__init__.py +3 -0
  4. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/client.py +21 -8
  5. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/devicemgmt.py +1 -3
  6. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/search.py +1 -1
  7. onvif_python-0.0.2/onvif/utils/zeep.py +49 -0
  8. {onvif_python-0.0.1 → onvif_python-0.0.2/onvif_python.egg-info}/PKG-INFO +3 -6
  9. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif_python.egg-info/SOURCES.txt +1 -0
  10. {onvif_python-0.0.1 → onvif_python-0.0.2}/pyproject.toml +1 -1
  11. {onvif_python-0.0.1 → onvif_python-0.0.2}/LICENSE.md +0 -0
  12. {onvif_python-0.0.1 → onvif_python-0.0.2}/MANIFEST.in +0 -0
  13. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/operator.py +0 -0
  14. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/__init__.py +0 -0
  15. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/accesscontrol.py +0 -0
  16. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/accessrules.py +0 -0
  17. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/actionengine.py +0 -0
  18. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/analytics/analytics.py +0 -0
  19. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/analytics/ruleengine.py +0 -0
  20. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/analyticsdevice.py +0 -0
  21. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/appmgmt.py +0 -0
  22. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/authenticationbehavior.py +0 -0
  23. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/credential.py +0 -0
  24. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/deviceio.py +0 -0
  25. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/display.py +0 -0
  26. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/doorcontrol.py +0 -0
  27. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/events/events.py +0 -0
  28. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/events/notification.py +0 -0
  29. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/events/pullpoint.py +0 -0
  30. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/events/subscription.py +0 -0
  31. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/imaging.py +0 -0
  32. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/media.py +0 -0
  33. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/media2.py +0 -0
  34. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/provisioning.py +0 -0
  35. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/ptz.py +0 -0
  36. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/receiver.py +0 -0
  37. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/recording.py +0 -0
  38. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/replay.py +0 -0
  39. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/schedule.py +0 -0
  40. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/security/advancedsecurity.py +0 -0
  41. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/security/authorizationserver.py +0 -0
  42. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/security/dot1x.py +0 -0
  43. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/security/jwt.py +0 -0
  44. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/security/keystore.py +0 -0
  45. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/security/mediasigning.py +0 -0
  46. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/security/tlsserver.py +0 -0
  47. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/thermal.py +0 -0
  48. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/services/uplink.py +0 -0
  49. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/utils/__init__.py +0 -0
  50. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/utils/exceptions.py +0 -0
  51. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/utils/wsdl.py +0 -0
  52. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/accesscontrol/wsdl/index.html +0 -0
  53. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/accessrules/wsdl/accessrules.wsdl +0 -0
  54. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/accessrules/wsdl/index.html +0 -0
  55. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/actionengine.wsdl +0 -0
  56. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/advancedsecurity/wsdl/advancedsecurity.wsdl +0 -0
  57. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/advancedsecurity/wsdl/index.html +0 -0
  58. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/analyticsdevice.wsdl +0 -0
  59. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/appmgmt/wsdl/appmgmt.wsdl +0 -0
  60. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/appmgmt/wsdl/index.html +0 -0
  61. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/authenticationbehavior/wsdl/authenticationbehavior.wsdl +0 -0
  62. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/authenticationbehavior/wsdl/index.html +0 -0
  63. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/credential/wsdl/credential.wsdl +0 -0
  64. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/credential/wsdl/index.html +0 -0
  65. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/device/wsdl/devicemgmt.wsdl +0 -0
  66. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/deviceio.wsdl +0 -0
  67. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/display/display.wsdl +0 -0
  68. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/display/wsdl/index.htm +0 -0
  69. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/display.wsdl +0 -0
  70. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/doorcontrol/wsdl/index.html +0 -0
  71. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/events/wsdl/bw-2-vs-mod.wsdl +0 -0
  72. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/events/wsdl/event-vs.wsdl +0 -0
  73. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/events/wsdl/event.wsdl +0 -0
  74. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/events/wsdl/index.html +0 -0
  75. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/federatedsearch.wsdl +0 -0
  76. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/media/wsdl/media.wsdl +0 -0
  77. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/pacs/accesscontrol.wsdl +0 -0
  78. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/pacs/doorcontrol.wsdl +0 -0
  79. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/pacs/types.xsd +0 -0
  80. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/provisioning/wsdl/provisioning.wsdl +0 -0
  81. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/receiver.wsdl +0 -0
  82. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/recording.wsdl +0 -0
  83. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/replay.wsdl +0 -0
  84. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/schedule/wsdl/index.html +0 -0
  85. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/schedule/wsdl/schedule.wsdl +0 -0
  86. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/schema/common.xsd +0 -0
  87. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/schema/metadatastream.xsd +0 -0
  88. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/schema/onvif.xsd +0 -0
  89. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/search.wsdl +0 -0
  90. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/thermal/wsdl/index.html +0 -0
  91. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/thermal/wsdl/thermal.wsdl +0 -0
  92. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/topics/topicns.xml +0 -0
  93. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/uplink/wsdl/index.html +0 -0
  94. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver10/uplink/wsdl/uplink.wsdl +0 -0
  95. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver20/analytics/humanbody.xsd +0 -0
  96. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver20/analytics/humanface.xsd +0 -0
  97. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver20/analytics/index.html +0 -0
  98. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver20/analytics/radiometry.xsd +0 -0
  99. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver20/analytics/rules.xsd +0 -0
  100. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver20/analytics/wsdl/analytics.wsdl +0 -0
  101. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver20/analytics/wsdl/index.html +0 -0
  102. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver20/imaging/wsdl/imaging.wsdl +0 -0
  103. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver20/media/wsdl/index.html +0 -0
  104. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver20/media/wsdl/media.wsdl +0 -0
  105. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver20/ptz/wsdl/ptz.wsdl +0 -0
  106. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver20/util/federated_search_documentation.html +0 -0
  107. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver20/util/fedsearch-docu-viewer.xsl +0 -0
  108. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver20/util/onvif-wsdl-viewer.xsl +0 -0
  109. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif/wsdl/ver20/util/operationIndex.html +0 -0
  110. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif_python.egg-info/dependency_links.txt +0 -0
  111. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif_python.egg-info/requires.txt +0 -0
  112. {onvif_python-0.0.1 → onvif_python-0.0.2}/onvif_python.egg-info/top_level.txt +0 -0
  113. {onvif_python-0.0.1 → onvif_python-0.0.2}/setup.cfg +0 -0
  114. {onvif_python-0.0.1 → onvif_python-0.0.2}/setup.py +0 -0
  115. {onvif_python-0.0.1 → onvif_python-0.0.2}/tests/test_client.py +0 -0
  116. {onvif_python-0.0.1 → onvif_python-0.0.2}/tests/test_core.py +0 -0
  117. {onvif_python-0.0.1 → onvif_python-0.0.2}/tests/test_exceptions.py +0 -0
  118. {onvif_python-0.0.1 → onvif_python-0.0.2}/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.1
3
+ Version: 0.0.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
@@ -44,7 +44,7 @@ Dynamic: license-file
44
44
  [![Release](https://img.shields.io/badge/Release-v0.0.1-green?logo=archive)](https://github.com/nirsimetri/onvif-python/releases)
45
45
  <br>
46
46
  [![PyPI](https://img.shields.io/badge/PyPI-0.0.1-yellow?logo=archive)](https://pypi.org/project/onvif-python/)
47
- [![Downloads](https://img.shields.io/pypi/dm/onvif-python?label=PyPI%20Downloads)](https://pypi.org/project/onvif-python/)
47
+ [![Downloads](https://img.shields.io/pypi/dd/onvif-python?label=PyPI%20Downloads&color=white)](https://pypi.org/project/onvif-python/)
48
48
 
49
49
  Are you having trouble finding a Python ONVIF library that supports your device?
50
50
  Are you confused about the compatibility of the various ONVIF versions, which are updated every six months?
@@ -108,11 +108,8 @@ client = ONVIFClient("192.168.1.17", 8000, "admin", "admin123")
108
108
  - `client.events()` — Events
109
109
  - `client.imaging()` — Imaging
110
110
  - `client.media()` — Media
111
- - `client.media2()` — Media 2
112
111
  - `client.ptz()` — PTZ (Pan-Tilt-Zoom)
113
- - `client.deviceio()` — Device IO
114
112
  - `client.analytics()` — Analytics
115
- - `client.recording()` — Recording
116
113
 
117
114
  and so on, check [Implemented ONVIF Services](https://github.com/nirsimetri/onvif-python?tab=readme-ov-file#implemented-onvif-services) for more details
118
115
 
@@ -200,7 +197,7 @@ This library fully supports all major ONVIF Profiles listed below. Each profile
200
197
  | Profile_T | [Document](https://www.onvif.org/wp-content/uploads/2018/09/ONVIF_Profile_T_Specification_v1-0.pdf) | Advanced video streaming (H.265, analytics metadata, motion detection) | Modern cameras and clients | ✅ Yes |
201
198
  | Profile_C | [Document](https://www.onvif.org/wp-content/uploads/2017/01/2013_12_ONVIF_Profile_C_Specification_v1-0.pdf) | Access control, door monitoring | Door controllers, access systems | ✅ Yes |
202
199
  | Profile_A | [Document](https://www.onvif.org/wp-content/uploads/2017/06/ONVIF_Profile_A_Specification_v1-0.pdf) | Advanced access control configuration, credential management | Access control clients and devices | ✅ Yes |
203
- | Profile_D | [Document](https://www.onvif.org/wp-content/uploads/2017/06/ONVIF_Profile_D_Specification_v1-0.pdf) | Access control peripherals (locks, sensors, relays) | Peripheral devices for access control | ✅ Yes |
200
+ | Profile_D | [Document](https://www.onvif.org/wp-content/uploads/2021/06/onvif-profile-d-specification-v1-0.pdf) | Access control peripherals (locks, sensors, relays) | Peripheral devices for access control | ✅ Yes |
204
201
  | Profile_M | [Document](https://www.onvif.org/wp-content/uploads/2024/04/onvif-profile-m-specification-v1-1.pdf) | Metadata, analytics events, object detection | Analytics devices, metadata clients | ✅ Yes |
205
202
 
206
203
  For a full description of each profile and its features, visit [ONVIF Profiles](https://www.onvif.org/profiles/).
@@ -5,7 +5,7 @@
5
5
  [![Release](https://img.shields.io/badge/Release-v0.0.1-green?logo=archive)](https://github.com/nirsimetri/onvif-python/releases)
6
6
  <br>
7
7
  [![PyPI](https://img.shields.io/badge/PyPI-0.0.1-yellow?logo=archive)](https://pypi.org/project/onvif-python/)
8
- [![Downloads](https://img.shields.io/pypi/dm/onvif-python?label=PyPI%20Downloads)](https://pypi.org/project/onvif-python/)
8
+ [![Downloads](https://img.shields.io/pypi/dd/onvif-python?label=PyPI%20Downloads&color=white)](https://pypi.org/project/onvif-python/)
9
9
 
10
10
  Are you having trouble finding a Python ONVIF library that supports your device?
11
11
  Are you confused about the compatibility of the various ONVIF versions, which are updated every six months?
@@ -69,11 +69,8 @@ client = ONVIFClient("192.168.1.17", 8000, "admin", "admin123")
69
69
  - `client.events()` — Events
70
70
  - `client.imaging()` — Imaging
71
71
  - `client.media()` — Media
72
- - `client.media2()` — Media 2
73
72
  - `client.ptz()` — PTZ (Pan-Tilt-Zoom)
74
- - `client.deviceio()` — Device IO
75
73
  - `client.analytics()` — Analytics
76
- - `client.recording()` — Recording
77
74
 
78
75
  and so on, check [Implemented ONVIF Services](https://github.com/nirsimetri/onvif-python?tab=readme-ov-file#implemented-onvif-services) for more details
79
76
 
@@ -161,7 +158,7 @@ This library fully supports all major ONVIF Profiles listed below. Each profile
161
158
  | Profile_T | [Document](https://www.onvif.org/wp-content/uploads/2018/09/ONVIF_Profile_T_Specification_v1-0.pdf) | Advanced video streaming (H.265, analytics metadata, motion detection) | Modern cameras and clients | ✅ Yes |
162
159
  | Profile_C | [Document](https://www.onvif.org/wp-content/uploads/2017/01/2013_12_ONVIF_Profile_C_Specification_v1-0.pdf) | Access control, door monitoring | Door controllers, access systems | ✅ Yes |
163
160
  | Profile_A | [Document](https://www.onvif.org/wp-content/uploads/2017/06/ONVIF_Profile_A_Specification_v1-0.pdf) | Advanced access control configuration, credential management | Access control clients and devices | ✅ Yes |
164
- | Profile_D | [Document](https://www.onvif.org/wp-content/uploads/2017/06/ONVIF_Profile_D_Specification_v1-0.pdf) | Access control peripherals (locks, sensors, relays) | Peripheral devices for access control | ✅ Yes |
161
+ | Profile_D | [Document](https://www.onvif.org/wp-content/uploads/2021/06/onvif-profile-d-specification-v1-0.pdf) | Access control peripherals (locks, sensors, relays) | Peripheral devices for access control | ✅ Yes |
165
162
  | Profile_M | [Document](https://www.onvif.org/wp-content/uploads/2024/04/onvif-profile-m-specification-v1-1.pdf) | Metadata, analytics events, object detection | Analytics devices, metadata clients | ✅ Yes |
166
163
 
167
164
  For a full description of each profile and its features, visit [ONVIF Profiles](https://www.onvif.org/profiles/).
@@ -3,6 +3,7 @@
3
3
  from .client import ONVIFClient
4
4
  from .operator import ONVIFOperator, CacheMode
5
5
  from .utils import ONVIFWSDL, ONVIFOperationException
6
+ from .utils.zeep import apply_patch
6
7
 
7
8
  __all__ = [
8
9
  "ONVIFClient",
@@ -11,3 +12,5 @@ __all__ = [
11
12
  "ONVIFWSDL",
12
13
  "ONVIFOperationException",
13
14
  ]
15
+
16
+ apply_patch()
@@ -130,32 +130,45 @@ class ONVIFClient:
130
130
  self._authorizationserver = None
131
131
  self._mediasigning = None
132
132
 
133
+
133
134
  def _get_xaddr(self, service_name: str, service_path: str):
134
135
  """
135
136
  Resolve XAddr from GetCapabilities. Fallback to default if not present.
137
+ Now supports nested Extension with _value_1 dict (after normalized parsing).
136
138
  """
137
139
  svc = getattr(self.capabilities, service_name, None)
138
- if svc and hasattr(svc, "XAddr") and svc.XAddr:
139
- parsed = urlparse(svc.XAddr)
140
140
 
141
+ # Step 1: check direct attribute (e.g. capabilities.Media)
142
+ if svc and hasattr(svc, "XAddr"):
143
+ xaddr = svc.XAddr
144
+ else:
145
+ # Step 2: try legacy Extension.service_name
146
+ ext = getattr(self.capabilities, "Extension", None)
147
+ if ext and hasattr(ext, service_name):
148
+ svc = getattr(ext, service_name, None)
149
+ xaddr = getattr(svc, "XAddr", None) if svc else None
150
+ else:
151
+ # Step 3: try new-style _value_1 dict inside Extension
152
+ ext_dict = getattr(ext, "_value_1", {})
153
+ xaddr = ext_dict.get(service_name, {}).get("XAddr") if isinstance(ext_dict, dict) else None
154
+
155
+ if xaddr:
156
+ parsed = urlparse(xaddr)
141
157
  # Host/port from device
142
158
  device_host = parsed.hostname
143
159
  device_port = parsed.port
144
-
145
160
  # Host/port from connection
146
161
  connect_host = self.common_args["host"]
147
162
  connect_port = self.common_args["port"]
148
-
149
163
  # if host/port differ, rewrite XAddr to use connection values
150
164
  if (device_host != connect_host) or (device_port != connect_port):
151
- protocol = parsed.scheme
165
+ protocol = "https" if self.common_args["use_https"] else "http"
152
166
  new_netloc = f"{connect_host}:{connect_port}"
153
167
  rewritten = urlunparse((protocol, new_netloc, parsed.path, "", "", ""))
154
168
  return rewritten
169
+ return xaddr
155
170
 
156
- return svc.XAddr
157
-
158
- # fallback (legacy style)
171
+ # Fallback default
159
172
  protocol = "https" if self.common_args["use_https"] else "http"
160
173
  return f"{protocol}://{self.common_args['host']}:{self.common_args['port']}/onvif/{service_path}"
161
174
 
@@ -16,9 +16,7 @@ class Device:
16
16
  )
17
17
 
18
18
  def GetServices(self, IncludeCapability):
19
- return self.operator.call(
20
- "GetServices", IncludeCapability=IncludeCapability
21
- )
19
+ return self.operator.call("GetServices", IncludeCapability=IncludeCapability)
22
20
 
23
21
  def GetServiceCapabilities(self):
24
22
  return self.operator.call("GetServiceCapabilities")
@@ -10,7 +10,7 @@ class Search:
10
10
  self.operator = ONVIFOperator(
11
11
  definition["path"],
12
12
  binding=f"{{{definition['namespace']}}}{definition['binding']}",
13
- service_path="Search", # fallback
13
+ service_path="SearchRecording", # fallback
14
14
  xaddr=xaddr,
15
15
  **kwargs,
16
16
  )
@@ -0,0 +1,49 @@
1
+ # onvif/utils/zeep.py
2
+
3
+ from lxml.etree import QName
4
+ from zeep.xsd.elements.any import Any
5
+ from zeep.xsd.utils import max_occurs_iter
6
+
7
+
8
+ def patched_parse_xmlelements(self, xmlelements, schema, name=None, context=None):
9
+ """Patched version of parse_xmlelements for <xsd:any> to support child parsing."""
10
+ parsed_result = {}
11
+
12
+ for _ in max_occurs_iter(self.max_occurs):
13
+ if not xmlelements:
14
+ break
15
+
16
+ xmlelement = xmlelements.popleft()
17
+ tag_name = QName(xmlelement.tag).localname
18
+ children = list(xmlelement)
19
+
20
+ if children and schema:
21
+ child_result = {}
22
+ for child in children:
23
+ child_qname = QName(child.tag)
24
+ try:
25
+ xsd_el = schema.get_element(child_qname)
26
+ val = xsd_el.parse_xmlelement(
27
+ child, schema=schema, allow_none=True, context=context
28
+ )
29
+ child_result[child_qname.localname] = val
30
+ except Exception:
31
+ if list(child): # has nested children
32
+ nested = {
33
+ QName(sub.tag).localname: sub.text or sub
34
+ for sub in child
35
+ }
36
+ child_result[child_qname.localname] = nested
37
+ else:
38
+ child_result[child_qname.localname] = child.text or child
39
+
40
+ parsed_result[tag_name] = child_result
41
+ else:
42
+ parsed_result[tag_name] = xmlelement.text or xmlelement
43
+
44
+ return parsed_result
45
+
46
+
47
+ def apply_patch():
48
+ """Inject the custom parse_xmlelements method into zeep.xsd.elements.any.Any."""
49
+ Any.parse_xmlelements = patched_parse_xmlelements
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: onvif-python
3
- Version: 0.0.1
3
+ Version: 0.0.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
@@ -44,7 +44,7 @@ Dynamic: license-file
44
44
  [![Release](https://img.shields.io/badge/Release-v0.0.1-green?logo=archive)](https://github.com/nirsimetri/onvif-python/releases)
45
45
  <br>
46
46
  [![PyPI](https://img.shields.io/badge/PyPI-0.0.1-yellow?logo=archive)](https://pypi.org/project/onvif-python/)
47
- [![Downloads](https://img.shields.io/pypi/dm/onvif-python?label=PyPI%20Downloads)](https://pypi.org/project/onvif-python/)
47
+ [![Downloads](https://img.shields.io/pypi/dd/onvif-python?label=PyPI%20Downloads&color=white)](https://pypi.org/project/onvif-python/)
48
48
 
49
49
  Are you having trouble finding a Python ONVIF library that supports your device?
50
50
  Are you confused about the compatibility of the various ONVIF versions, which are updated every six months?
@@ -108,11 +108,8 @@ client = ONVIFClient("192.168.1.17", 8000, "admin", "admin123")
108
108
  - `client.events()` — Events
109
109
  - `client.imaging()` — Imaging
110
110
  - `client.media()` — Media
111
- - `client.media2()` — Media 2
112
111
  - `client.ptz()` — PTZ (Pan-Tilt-Zoom)
113
- - `client.deviceio()` — Device IO
114
112
  - `client.analytics()` — Analytics
115
- - `client.recording()` — Recording
116
113
 
117
114
  and so on, check [Implemented ONVIF Services](https://github.com/nirsimetri/onvif-python?tab=readme-ov-file#implemented-onvif-services) for more details
118
115
 
@@ -200,7 +197,7 @@ This library fully supports all major ONVIF Profiles listed below. Each profile
200
197
  | Profile_T | [Document](https://www.onvif.org/wp-content/uploads/2018/09/ONVIF_Profile_T_Specification_v1-0.pdf) | Advanced video streaming (H.265, analytics metadata, motion detection) | Modern cameras and clients | ✅ Yes |
201
198
  | Profile_C | [Document](https://www.onvif.org/wp-content/uploads/2017/01/2013_12_ONVIF_Profile_C_Specification_v1-0.pdf) | Access control, door monitoring | Door controllers, access systems | ✅ Yes |
202
199
  | Profile_A | [Document](https://www.onvif.org/wp-content/uploads/2017/06/ONVIF_Profile_A_Specification_v1-0.pdf) | Advanced access control configuration, credential management | Access control clients and devices | ✅ Yes |
203
- | Profile_D | [Document](https://www.onvif.org/wp-content/uploads/2017/06/ONVIF_Profile_D_Specification_v1-0.pdf) | Access control peripherals (locks, sensors, relays) | Peripheral devices for access control | ✅ Yes |
200
+ | Profile_D | [Document](https://www.onvif.org/wp-content/uploads/2021/06/onvif-profile-d-specification-v1-0.pdf) | Access control peripherals (locks, sensors, relays) | Peripheral devices for access control | ✅ Yes |
204
201
  | Profile_M | [Document](https://www.onvif.org/wp-content/uploads/2024/04/onvif-profile-m-specification-v1-1.pdf) | Metadata, analytics events, object detection | Analytics devices, metadata clients | ✅ Yes |
205
202
 
206
203
  For a full description of each profile and its features, visit [ONVIF Profiles](https://www.onvif.org/profiles/).
@@ -46,6 +46,7 @@ onvif/services/security/tlsserver.py
46
46
  onvif/utils/__init__.py
47
47
  onvif/utils/exceptions.py
48
48
  onvif/utils/wsdl.py
49
+ onvif/utils/zeep.py
49
50
  onvif/wsdl/ver10/actionengine.wsdl
50
51
  onvif/wsdl/ver10/analyticsdevice.wsdl
51
52
  onvif/wsdl/ver10/deviceio.wsdl
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "onvif-python"
7
- version = "0.0.1"
7
+ version = "0.0.2"
8
8
  description = "A comprehensive and developer-friendly Python library for working with ONVIF-compliant devices"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.9"
File without changes
File without changes
File without changes
File without changes