![]() parse () # Use helper methods to extract data by attribute device. Usage from device_detector import DeviceDetector ua = 'Mozilla/5.0 (Linux Android 4.3 C5502 Build/10.4.1.B.0.101) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/.136 Mobile Safari/537.36' # Parse UA string and load data to dict of 'os', 'client', 'device' keys device = DeviceDetector ( ua ). The mrab regex module is preferred if installed. Pip install device_detector Performance OptionsĬSafeLoader is used if pyyaml is configured -with-libyaml. However, it uses the original regex yaml files, to benefit from updates and pull request to both the original and the ported versions. This port is not an exact copy of the original code some Pythonic adaptations were used. This project originated as a Python port of the Universal Device Detection library. The DeviceDetector is optimized for speed of detection, by providing optimized code and in-memory caching. DeviceDetector detects thousands of user agent strings, even from rare and obscure browsers and devices. DeviceDetector is a precise and fast user agent parser and device detector written in Python, backed by the largest and most up-to-date user agent database.ĭeviceDetector will parse any user agent and detect the browser, operating system, device used (desktop, tablet, mobile, tv, cars, console, etc.), brand and model. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2023
Categories |