python-user-agents
python-user-agents copied to clipboard
Add ability to dump json
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.
I think it will be easily done by import ujson, then you just do: ujson.dumps(parse(ua_agent_string))