A Python library for parsing user agent strings to identify device types, operating systems, browsers, and capabilities.
Python User Agents is a library that parses HTTP user agent strings to identify devices, browsers, and operating systems. It helps developers detect whether a visitor is using a mobile phone, tablet, or PC, and determines capabilities like touch screen support. This is useful for analytics, content adaptation, and improving user experience based on device characteristics.
Python developers building web applications, analytics tools, or middleware that need to adapt content or track usage based on visitor device types and capabilities.
It provides a simple, reliable interface on top of the well-maintained ua-parser project, offering derived attributes like is_mobile and is_touch_capable that abstract away the complexity of raw user agent string parsing.
A Python library that provides an easy way to identify devices like mobile phones, tablets and their capabilities by parsing (browser) user agent strings.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides easy access to parsed data through attributes like browser.family and device.model, making code readable and intuitive, as shown in the README examples for iPhone and BlackBerry.
Includes convenient attributes like is_touch_capable and is_bot that abstract complex detection logic, saving development time for common use cases such as adapting to touch devices.
Builds on the well-maintained ua-parser project, ensuring accurate and up-to-date parsing of user agent strings, which is noted in the philosophy section for reliability.
Offers a human-readable summary via str(user_agent), useful for logging and debugging, as demonstrated with outputs like 'iPhone / iOS 5.1 / Mobile Safari 5.1'.
Tightly coupled with ua-parser, so any bugs, breaking changes, or delays in updates from that library directly affect stability, as seen in changelog entries requiring specific ua-parser versions.
Requires installing multiple packages (pyyaml, ua-parser, user-agents) separately, adding complexity compared to all-in-one solutions, which the README admits in the installation steps.
Cannot easily extend or tweak parsing rules beyond what ua-parser provides, making it less flexible for niche or custom device detection needs not covered by the base library.