onvif-python 0.0.4__tar.gz → 0.0.6__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.
- {onvif_python-0.0.4/onvif_python.egg-info → onvif_python-0.0.6}/PKG-INFO +56 -20
- {onvif_python-0.0.4 → onvif_python-0.0.6}/README.md +51 -17
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/__init__.py +2 -2
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/client.py +92 -69
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/operator.py +3 -1
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/accesscontrol.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/accessrules.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/actionengine.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/analytics/analytics.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/analytics/ruleengine.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/analyticsdevice.py +4 -3
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/appmgmt.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/authenticationbehavior.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/credential.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/deviceio.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/devicemgmt.py +6 -1
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/display.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/doorcontrol.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/events/events.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/events/notification.py +4 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/events/pullpoint.py +4 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/events/subscription.py +4 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/imaging.py +6 -1
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/media.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/media2.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/provisioning.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/ptz.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/receiver.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/recording.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/replay.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/schedule.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/search.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/security/advancedsecurity.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/security/authorizationserver.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/security/dot1x.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/security/jwt.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/security/keystore.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/security/mediasigning.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/security/tlsserver.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/thermal.py +5 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/uplink.py +5 -0
- onvif_python-0.0.6/onvif/utils/__init__.py +5 -0
- onvif_python-0.0.6/onvif/utils/xml_capture.py +110 -0
- onvif_python-0.0.6/onvif/utils/zeep.py +286 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/schema/onvif.xsd +1 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6/onvif_python.egg-info}/PKG-INFO +56 -20
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif_python.egg-info/SOURCES.txt +1 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/pyproject.toml +5 -3
- onvif_python-0.0.4/onvif/utils/__init__.py +0 -4
- onvif_python-0.0.4/onvif/utils/zeep.py +0 -230
- {onvif_python-0.0.4 → onvif_python-0.0.6}/LICENSE.md +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/MANIFEST.in +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/services/__init__.py +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/utils/exceptions.py +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/utils/wsdl.py +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/accesscontrol/wsdl/index.html +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/accessrules/wsdl/accessrules.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/accessrules/wsdl/index.html +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/actionengine.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/advancedsecurity/wsdl/advancedsecurity.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/advancedsecurity/wsdl/index.html +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/analyticsdevice.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/appmgmt/wsdl/appmgmt.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/appmgmt/wsdl/index.html +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/authenticationbehavior/wsdl/authenticationbehavior.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/authenticationbehavior/wsdl/index.html +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/credential/wsdl/credential.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/credential/wsdl/index.html +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/device/wsdl/devicemgmt.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/deviceio.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/display/display.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/display/wsdl/index.htm +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/display.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/doorcontrol/wsdl/index.html +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/events/wsdl/bw-2-vs-mod.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/events/wsdl/event-vs.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/events/wsdl/event.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/events/wsdl/index.html +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/federatedsearch.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/media/wsdl/media.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/pacs/accesscontrol.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/pacs/doorcontrol.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/pacs/types.xsd +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/provisioning/wsdl/provisioning.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/receiver.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/recording.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/replay.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/schedule/wsdl/index.html +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/schedule/wsdl/schedule.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/schema/common.xsd +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/schema/metadatastream.xsd +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/search.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/thermal/wsdl/index.html +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/thermal/wsdl/thermal.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/topics/topicns.xml +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/uplink/wsdl/index.html +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver10/uplink/wsdl/uplink.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver20/analytics/humanbody.xsd +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver20/analytics/humanface.xsd +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver20/analytics/index.html +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver20/analytics/radiometry.xsd +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver20/analytics/rules.xsd +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver20/analytics/wsdl/analytics.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver20/analytics/wsdl/index.html +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver20/imaging/wsdl/imaging.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver20/media/wsdl/index.html +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver20/media/wsdl/media.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver20/ptz/wsdl/ptz.wsdl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver20/util/federated_search_documentation.html +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver20/util/fedsearch-docu-viewer.xsl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver20/util/onvif-wsdl-viewer.xsl +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif/wsdl/ver20/util/operationIndex.html +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif_python.egg-info/dependency_links.txt +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif_python.egg-info/requires.txt +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/onvif_python.egg-info/top_level.txt +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/setup.cfg +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/setup.py +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/tests/test_client.py +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/tests/test_core.py +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/tests/test_exceptions.py +0 -0
- {onvif_python-0.0.4 → onvif_python-0.0.6}/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.
|
|
3
|
+
Version: 0.0.6
|
|
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
|
|
@@ -10,8 +10,8 @@ Project-URL: Issues, https://github.com/nirsimetri/onvif-python/issues
|
|
|
10
10
|
Project-URL: Documentation, https://deepwiki.com/nirsimetri/onvif-python
|
|
11
11
|
Project-URL: Repository, https://github.com/nirsimetri/onvif-python.git
|
|
12
12
|
Project-URL: Changelog, https://github.com/nirsimetri/onvif-python/releases
|
|
13
|
-
Keywords:
|
|
14
|
-
Classifier: Development Status ::
|
|
13
|
+
Keywords: onvif,Camera,onvif-python,ip-camera,cctv,soap,surveillance,cctv cameras,soap-client,onvif-client,onvif-library,onvif-specifications
|
|
14
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
15
15
|
Classifier: Environment :: Console
|
|
16
16
|
Classifier: Programming Language :: Python :: 3
|
|
17
17
|
Classifier: Programming Language :: Python :: 3.9
|
|
@@ -25,7 +25,9 @@ Classifier: Topic :: Security
|
|
|
25
25
|
Classifier: Topic :: Multimedia :: Video
|
|
26
26
|
Classifier: Topic :: Multimedia :: Sound/Audio
|
|
27
27
|
Classifier: Topic :: Communications
|
|
28
|
+
Classifier: Topic :: Text Processing :: Markup :: XML
|
|
28
29
|
Classifier: Natural Language :: English
|
|
30
|
+
Classifier: Natural Language :: Indonesian
|
|
29
31
|
Requires-Python: >=3.9
|
|
30
32
|
Description-Content-Type: text/markdown
|
|
31
33
|
License-File: LICENSE.md
|
|
@@ -41,9 +43,9 @@ Dynamic: license-file
|
|
|
41
43
|
|
|
42
44
|
[](https://github.com/nirsimetri/onvif-python?tab=MIT-1-ov-file)
|
|
43
45
|
[](https://deepwiki.com/nirsimetri/onvif-python)
|
|
44
|
-
[](https://github.com/nirsimetri/onvif-python/releases)
|
|
45
47
|
<br>
|
|
46
|
-
[](https://pypi.org/project/onvif-python/)
|
|
47
49
|
[](https://clickpy.clickhouse.com/dashboard/onvif-python)
|
|
48
50
|
|
|
49
51
|
Are you having trouble finding a Python ONVIF library that supports your device?
|
|
@@ -148,32 +150,64 @@ Explore more advanced usage and service-specific operations in the [`examples/`]
|
|
|
148
150
|
> [!IMPORTANT]
|
|
149
151
|
> 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.
|
|
150
152
|
|
|
151
|
-
##
|
|
153
|
+
## Service Discovery: Understanding Device Capabilities
|
|
152
154
|
|
|
153
155
|
> [!WARNING]
|
|
154
|
-
> Before performing any operations on an ONVIF device, it is highly recommended to
|
|
156
|
+
> Before performing any operations on an ONVIF device, it is highly recommended to discover which services are available and supported by the device. This library automatically uses `GetServices` during initialization to discover service endpoints, but you can also query services manually for detailed information including capabilities.
|
|
155
157
|
|
|
156
|
-
**Why
|
|
158
|
+
**Why discover device services?**
|
|
157
159
|
|
|
158
|
-
- **Device Diversity:** Not all ONVIF devices support every
|
|
159
|
-
- **Error Prevention:** Attempting to use unsupported
|
|
160
|
-
- **Dynamic Feature Detection:** Devices may enable or disable
|
|
161
|
-
- **Optimized Integration:** By checking available
|
|
160
|
+
- **Device Diversity:** Not all ONVIF devices support every service. Available services may vary by manufacturer, model, firmware, or configuration.
|
|
161
|
+
- **Error Prevention:** Attempting to use unsupported services can result in failed requests, exceptions, or undefined behavior.
|
|
162
|
+
- **Dynamic Feature Detection:** Devices may enable or disable services over time (e.g., after firmware updates or configuration changes).
|
|
163
|
+
- **Optimized Integration:** By checking available services, your application can adapt its workflow and UI to match the device's actual features.
|
|
162
164
|
|
|
163
|
-
**How
|
|
165
|
+
**How service discovery works in this library:**
|
|
164
166
|
|
|
165
|
-
|
|
167
|
+
The `ONVIFClient` automatically calls `GetServices` during initialization to build a service map. This map is used internally to resolve service endpoints:
|
|
166
168
|
|
|
167
169
|
```python
|
|
168
170
|
from onvif import ONVIFClient
|
|
169
171
|
|
|
170
172
|
client = ONVIFClient("192.168.1.17", 8000, "admin", "admin123")
|
|
173
|
+
|
|
174
|
+
# Access the discovered services
|
|
175
|
+
print(client.services)
|
|
176
|
+
# Example output: [{'Namespace': 'http://www.onvif.org/ver10/device/wsdl', 'XAddr': '...', 'Version': {...}}, ...]
|
|
177
|
+
|
|
178
|
+
# Check the service map (namespace -> XAddr mapping)
|
|
179
|
+
print(client._service_map)
|
|
180
|
+
# Example output: {'http://www.onvif.org/ver10/media/wsdl': 'http://192.168.1.17:8000/onvif/Media', ...}
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**Get detailed service information with capabilities:**
|
|
184
|
+
|
|
185
|
+
If you need detailed capability information for each service, call `GetServices` with `IncludeCapability=True`:
|
|
186
|
+
|
|
187
|
+
```python
|
|
188
|
+
device = client.devicemgmt()
|
|
189
|
+
services = device.GetServices(IncludeCapability=True)
|
|
190
|
+
|
|
191
|
+
for service in services:
|
|
192
|
+
print(f"Service: {service.Namespace}")
|
|
193
|
+
print(f"Endpoint: {service.XAddr}")
|
|
194
|
+
print(f"Version: {service.Version.Major}.{service.Version.Minor}")
|
|
195
|
+
if hasattr(service, 'Capabilities') and service.Capabilities:
|
|
196
|
+
print(f"Capabilities: {service.Capabilities}")
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
**Alternative: Use GetCapabilities for legacy compatibility:**
|
|
200
|
+
|
|
201
|
+
For backward compatibility or when you need a quick overview of major service categories, you can still use `GetCapabilities`:
|
|
202
|
+
|
|
203
|
+
```python
|
|
171
204
|
capabilities = client.devicemgmt().GetCapabilities()
|
|
172
205
|
print(capabilities)
|
|
173
|
-
# Example output: {'Media': {'XAddr': '
|
|
206
|
+
# Example output: {'Media': {'XAddr': '...', ...}, 'PTZ': {...}, 'Events': {...}, ...}
|
|
174
207
|
```
|
|
175
208
|
|
|
176
|
-
|
|
209
|
+
> [!TIP]
|
|
210
|
+
> The library handles service discovery automatically, so you typically don't need to call `GetServices` manually unless you need detailed capability information or want to refresh the service list after device configuration changes.
|
|
177
211
|
|
|
178
212
|
## Tested Devices
|
|
179
213
|
|
|
@@ -283,6 +317,7 @@ Some ONVIF services have multiple bindings in the same WSDL. These typically inc
|
|
|
283
317
|
client.events() # root binding
|
|
284
318
|
client.pullpoint(subscription) # sub-binding (dynamic, via SubscriptionReference.Address)
|
|
285
319
|
client.subscription(subscription) # sub-binding (dynamic, via SubscriptionReference.Address)
|
|
320
|
+
client.notification() # sub-binding accessor
|
|
286
321
|
```
|
|
287
322
|
|
|
288
323
|
2. **Security (Advanced Security)**
|
|
@@ -290,7 +325,6 @@ Some ONVIF services have multiple bindings in the same WSDL. These typically inc
|
|
|
290
325
|
- **Sub-bindings:**
|
|
291
326
|
- `AuthorizationServerBinding`
|
|
292
327
|
- `KeystoreBinding`
|
|
293
|
-
- `CredentialBinding`
|
|
294
328
|
- `JWTBinding`
|
|
295
329
|
- `Dot1XBinding`
|
|
296
330
|
- `TLSServerBinding`
|
|
@@ -300,7 +334,7 @@ Some ONVIF services have multiple bindings in the same WSDL. These typically inc
|
|
|
300
334
|
```python
|
|
301
335
|
client.security() # root binding
|
|
302
336
|
client.authorizationserver(xaddr) # sub-binding accessor (requires xAddr)
|
|
303
|
-
client.keystore(xaddr)
|
|
337
|
+
client.keystore(xaddr) # ..
|
|
304
338
|
client.jwt(xaddr)
|
|
305
339
|
client.dot1x(xaddr)
|
|
306
340
|
client.tlsserver(xaddr)
|
|
@@ -326,10 +360,12 @@ Some ONVIF services have multiple bindings in the same WSDL. These typically inc
|
|
|
326
360
|
|
|
327
361
|
## Future Improvements (Stay tuned and star ⭐ this repo)
|
|
328
362
|
|
|
363
|
+
- [x] Add debugging mode with raw xml on SOAP requests and responses. ([c258162](https://github.com/nirsimetri/onvif-python/commit/c258162))
|
|
364
|
+
- [ ] Add functionality for `ONVIFClient` to accept a custom `wsdl_path` service.
|
|
365
|
+
- [ ] Add asynchronous (async/await) support for non-blocking ONVIF operations and concurrent device communication.
|
|
366
|
+
- [ ] Add `ONVIF CLI` program to interact directly with ONVIF devices via terminal.
|
|
329
367
|
- [ ] Implement structured data models for ONVIF Schemas using [xsdata](https://github.com/tefra/xsdata).
|
|
330
368
|
- [ ] Integrate [xmltodict](https://github.com/martinblech/xmltodict) for simplified XML parsing and conversion.
|
|
331
|
-
- [ ] Add functionality for `ONVIFClient` to accept a custom `wsdl_path` service.
|
|
332
|
-
- [ ] Add debugging mode with raw xml on SOAP requests and responses.
|
|
333
369
|
- [ ] Enhance documentation with API references and diagrams (not from [AI Wiki](https://deepwiki.com/nirsimetri/onvif-python)).
|
|
334
370
|
- [ ] Add more usage examples for advanced features.
|
|
335
371
|
- [ ] Add benchmarking and performance metrics.
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://github.com/nirsimetri/onvif-python?tab=MIT-1-ov-file)
|
|
4
4
|
[](https://deepwiki.com/nirsimetri/onvif-python)
|
|
5
|
-
[](https://github.com/nirsimetri/onvif-python/releases)
|
|
6
6
|
<br>
|
|
7
|
-
[](https://pypi.org/project/onvif-python/)
|
|
8
8
|
[](https://clickpy.clickhouse.com/dashboard/onvif-python)
|
|
9
9
|
|
|
10
10
|
Are you having trouble finding a Python ONVIF library that supports your device?
|
|
@@ -109,32 +109,64 @@ Explore more advanced usage and service-specific operations in the [`examples/`]
|
|
|
109
109
|
> [!IMPORTANT]
|
|
110
110
|
> 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
111
|
|
|
112
|
-
##
|
|
112
|
+
## Service Discovery: Understanding Device Capabilities
|
|
113
113
|
|
|
114
114
|
> [!WARNING]
|
|
115
|
-
> Before performing any operations on an ONVIF device, it is highly recommended to
|
|
115
|
+
> Before performing any operations on an ONVIF device, it is highly recommended to discover which services are available and supported by the device. This library automatically uses `GetServices` during initialization to discover service endpoints, but you can also query services manually for detailed information including capabilities.
|
|
116
116
|
|
|
117
|
-
**Why
|
|
117
|
+
**Why discover device services?**
|
|
118
118
|
|
|
119
|
-
- **Device Diversity:** Not all ONVIF devices support every
|
|
120
|
-
- **Error Prevention:** Attempting to use unsupported
|
|
121
|
-
- **Dynamic Feature Detection:** Devices may enable or disable
|
|
122
|
-
- **Optimized Integration:** By checking available
|
|
119
|
+
- **Device Diversity:** Not all ONVIF devices support every service. Available services may vary by manufacturer, model, firmware, or configuration.
|
|
120
|
+
- **Error Prevention:** Attempting to use unsupported services can result in failed requests, exceptions, or undefined behavior.
|
|
121
|
+
- **Dynamic Feature Detection:** Devices may enable or disable services over time (e.g., after firmware updates or configuration changes).
|
|
122
|
+
- **Optimized Integration:** By checking available services, your application can adapt its workflow and UI to match the device's actual features.
|
|
123
123
|
|
|
124
|
-
**How
|
|
124
|
+
**How service discovery works in this library:**
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
The `ONVIFClient` automatically calls `GetServices` during initialization to build a service map. This map is used internally to resolve service endpoints:
|
|
127
127
|
|
|
128
128
|
```python
|
|
129
129
|
from onvif import ONVIFClient
|
|
130
130
|
|
|
131
131
|
client = ONVIFClient("192.168.1.17", 8000, "admin", "admin123")
|
|
132
|
+
|
|
133
|
+
# Access the discovered services
|
|
134
|
+
print(client.services)
|
|
135
|
+
# Example output: [{'Namespace': 'http://www.onvif.org/ver10/device/wsdl', 'XAddr': '...', 'Version': {...}}, ...]
|
|
136
|
+
|
|
137
|
+
# Check the service map (namespace -> XAddr mapping)
|
|
138
|
+
print(client._service_map)
|
|
139
|
+
# Example output: {'http://www.onvif.org/ver10/media/wsdl': 'http://192.168.1.17:8000/onvif/Media', ...}
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
**Get detailed service information with capabilities:**
|
|
143
|
+
|
|
144
|
+
If you need detailed capability information for each service, call `GetServices` with `IncludeCapability=True`:
|
|
145
|
+
|
|
146
|
+
```python
|
|
147
|
+
device = client.devicemgmt()
|
|
148
|
+
services = device.GetServices(IncludeCapability=True)
|
|
149
|
+
|
|
150
|
+
for service in services:
|
|
151
|
+
print(f"Service: {service.Namespace}")
|
|
152
|
+
print(f"Endpoint: {service.XAddr}")
|
|
153
|
+
print(f"Version: {service.Version.Major}.{service.Version.Minor}")
|
|
154
|
+
if hasattr(service, 'Capabilities') and service.Capabilities:
|
|
155
|
+
print(f"Capabilities: {service.Capabilities}")
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**Alternative: Use GetCapabilities for legacy compatibility:**
|
|
159
|
+
|
|
160
|
+
For backward compatibility or when you need a quick overview of major service categories, you can still use `GetCapabilities`:
|
|
161
|
+
|
|
162
|
+
```python
|
|
132
163
|
capabilities = client.devicemgmt().GetCapabilities()
|
|
133
164
|
print(capabilities)
|
|
134
|
-
# Example output: {'Media': {'XAddr': '
|
|
165
|
+
# Example output: {'Media': {'XAddr': '...', ...}, 'PTZ': {...}, 'Events': {...}, ...}
|
|
135
166
|
```
|
|
136
167
|
|
|
137
|
-
|
|
168
|
+
> [!TIP]
|
|
169
|
+
> The library handles service discovery automatically, so you typically don't need to call `GetServices` manually unless you need detailed capability information or want to refresh the service list after device configuration changes.
|
|
138
170
|
|
|
139
171
|
## Tested Devices
|
|
140
172
|
|
|
@@ -244,6 +276,7 @@ Some ONVIF services have multiple bindings in the same WSDL. These typically inc
|
|
|
244
276
|
client.events() # root binding
|
|
245
277
|
client.pullpoint(subscription) # sub-binding (dynamic, via SubscriptionReference.Address)
|
|
246
278
|
client.subscription(subscription) # sub-binding (dynamic, via SubscriptionReference.Address)
|
|
279
|
+
client.notification() # sub-binding accessor
|
|
247
280
|
```
|
|
248
281
|
|
|
249
282
|
2. **Security (Advanced Security)**
|
|
@@ -251,7 +284,6 @@ Some ONVIF services have multiple bindings in the same WSDL. These typically inc
|
|
|
251
284
|
- **Sub-bindings:**
|
|
252
285
|
- `AuthorizationServerBinding`
|
|
253
286
|
- `KeystoreBinding`
|
|
254
|
-
- `CredentialBinding`
|
|
255
287
|
- `JWTBinding`
|
|
256
288
|
- `Dot1XBinding`
|
|
257
289
|
- `TLSServerBinding`
|
|
@@ -261,7 +293,7 @@ Some ONVIF services have multiple bindings in the same WSDL. These typically inc
|
|
|
261
293
|
```python
|
|
262
294
|
client.security() # root binding
|
|
263
295
|
client.authorizationserver(xaddr) # sub-binding accessor (requires xAddr)
|
|
264
|
-
client.keystore(xaddr)
|
|
296
|
+
client.keystore(xaddr) # ..
|
|
265
297
|
client.jwt(xaddr)
|
|
266
298
|
client.dot1x(xaddr)
|
|
267
299
|
client.tlsserver(xaddr)
|
|
@@ -287,10 +319,12 @@ Some ONVIF services have multiple bindings in the same WSDL. These typically inc
|
|
|
287
319
|
|
|
288
320
|
## Future Improvements (Stay tuned and star ⭐ this repo)
|
|
289
321
|
|
|
322
|
+
- [x] Add debugging mode with raw xml on SOAP requests and responses. ([c258162](https://github.com/nirsimetri/onvif-python/commit/c258162))
|
|
323
|
+
- [ ] Add functionality for `ONVIFClient` to accept a custom `wsdl_path` service.
|
|
324
|
+
- [ ] Add asynchronous (async/await) support for non-blocking ONVIF operations and concurrent device communication.
|
|
325
|
+
- [ ] Add `ONVIF CLI` program to interact directly with ONVIF devices via terminal.
|
|
290
326
|
- [ ] Implement structured data models for ONVIF Schemas using [xsdata](https://github.com/tefra/xsdata).
|
|
291
327
|
- [ ] Integrate [xmltodict](https://github.com/martinblech/xmltodict) for simplified XML parsing and conversion.
|
|
292
|
-
- [ ] Add functionality for `ONVIFClient` to accept a custom `wsdl_path` service.
|
|
293
|
-
- [ ] Add debugging mode with raw xml on SOAP requests and responses.
|
|
294
328
|
- [ ] Enhance documentation with API references and diagrams (not from [AI Wiki](https://deepwiki.com/nirsimetri/onvif-python)).
|
|
295
329
|
- [ ] Add more usage examples for advanced features.
|
|
296
330
|
- [ ] Add benchmarking and performance metrics.
|