FalkTannhaeuser / python-onvif-zeep

ONVIF Client Implementation in Python 2+3 (using https://github.com/mvantellingen/python-zeep instead of suds as SOAP client)
MIT License
424 stars 138 forks source link

How to convert a NetworkInterface to a dictionary? #64

Open Calinou opened 4 years ago

Calinou commented 4 years ago

Python version: 3.7.6 onvif-zeep version: 0.2.12 (from this repository)

I'd like to return a response of type NetworkInterface as a Python dictionary, so it can be returned as JSON by Flask. I've tried answers from this Stack Overflow thread but couldn't get any of them to work. As far as I know, some of the answers there don't apply as I can't modify the class declaration (since it's part of the library).

I could map all fields to a dictionary manually, but it's a lot of work and will probably end up missing fields that are only sometimes present.