A pure Python User Agent parser.
- Author: Daniel J. Umpierrez
- License: UNLICENSE
- Version: 0.1.0
Parse a User Agent raw string and parse it to a Operative System, Device, and Browser objects.
pip install git+https://github.com/havocesp/pyuaparser
from pyuaparser import UserAgent
if __name__ == '___main__':
user_agent = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.113 Safari/537.36'
ua = UserAgent(user_agent)
print(ua) # prints: PC/Windows 10/Chrome 60.3112
print(ua.os.family) # prints: Windows
print(ua.os.major) # prints: 10
Project changes over versions.
- Initial version