python-user-agents icon indicating copy to clipboard operation
python-user-agents copied to clipboard

Add ability to dump json

Open hakib opened this issue 11 years ago • 1 comments

Dumping the object to JSON could be great. As far as i know namedtuples are not serializeable so i use jsno.dumps(ua.browser.__dict__). Plus, Exposing the ua_parser parsed dict as a property as well.

The true added value here is the is_mobile/pc/tablet/touch properties.

hakib avatar Sep 24 '14 07:09 hakib

I think it will be easily done by import ujson, then you just do: ujson.dumps(parse(ua_agent_string))

vnnw avatar Sep 30 '15 09:09 vnnw