Skip to content

Add ONVIFResponse wrapper for zeep objects with serialization support#15

Merged
kaburagisec merged 1 commit intonirsimetri:devfrom
kaburagisec:dev
Dec 23, 2025
Merged

Add ONVIFResponse wrapper for zeep objects with serialization support#15
kaburagisec merged 1 commit intonirsimetri:devfrom
kaburagisec:dev

Conversation

@kaburagisec
Copy link
Contributor

This PR will allow us to convert ONVIF operation responses containing zeep objects into dicts using the to_dict() helper function.

Example usage:

from onvif import ONVIFClient

client = ONVIFClient('192.168.1.100', 80, 'admin', 'password')
device = client.devicemgmt()

# usual usage (zeep object)
info = device.GetDeviceInformation()
print(info.Manufacturer)
print(info.Model)

# convert to dict with to_dict() function
info_dict = info.to_dict()
print(info_dict)
# Output: {
#     'Manufacturer': 'ACME',
#     'Model': 'Camera-1000',
#     'FirmwareVersion': '1.0.0',
#     'SerialNumber': '12345',
#     'HardwareId': 'v1.0'
# }

# another examples
capabilities = device.GetCapabilities()
caps_dict = capabilities.to_dict()

@kaburagisec kaburagisec merged commit 37dcb70 into nirsimetri:dev Dec 23, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant