--- id: user-agents version: "2.2.0" license: MIT license_treatment: permissive maintenance: abandoned --- # user-agents — A library to identify devices (phones, tablets) and their capabilities by parsing browser user agent strings. License: permissive · Maintenance: abandoned · Downloads: 11.6M/mo ## What it is and what it does user-agents is a Python library that wraps ua-parser to parse HTTP user agent strings and classify the requesting device. It identifies whether a user agent belongs to a mobile phone, tablet, or desktop PC; detects touch capabilities; and extracts structured information about the browser family, OS, device brand, and model. The library exposes convenience methods like is_mobile, is_tablet, is_pc, is_touch_capable, and is_bot to make device detection straightforward in web applications. The package relies entirely on ua-parser to do the actual parsing work and maintains a thin, user-friendly API on top. It has been stable since its 2.0 release in 2019 and is classified as Production/Stable, but development has stalled—the last update was in August 2020, and the repository shows no activity since February 2023. This means the underlying device and browser database will become increasingly outdated as new devices and user agent formats emerge. Use it for: - Serve mobile-optimized content or layouts based on device type detection in web frameworks. - Block or flag bot traffic by identifying search engine crawlers and spiders in request logs. - Customize user experience by detecting touch-capable devices and enabling touch-friendly interactions. - Log and analyze visitor device demographics (mobile vs. tablet vs. desktop) for analytics. - Implement device-specific feature flags or API responses in REST or GraphQL backends. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Parses browser user agent strings to identify device type (mobile, tablet, PC), detect touch capabilities, and extract browser and OS information. Yes, with conditions. Install if you need straightforward user agent parsing for a stable, mature codebase and can tolerate outdated device/browser data. The low install friction, permissive MIT license, and zero known vulnerabilities make it safe to add. However, do not install if you require current detection of recent devices, browsers, or user agent formats—the package is abandoned and will not track new user agents. For new projects, evaluate whether ua-parser alone or a more actively maintained alternative better suits your needs. ## Install pip install user-agents uv add user-agents poetry add user-agents ## Installing user-agents Before you install: Low install friction with a single runtime dependency (ua-parser). However, the package is abandoned—last release was 2020-08-23 and last commit 2023-02-16—so it will not receive bug fixes or updates for newer user agents or Python versions. License in practice: MIT license is permissive, allowing commercial and private use with minimal restrictions. You may use, modify, and distribute this package freely as long as you include the original license notice. Quickstart: pip install user-agents from user_agents import parse ua_string = 'Mozilla/5.0 (iPhone; CPU iPhone OS 5_1 like Mac OS X) AppleWebKit/534.46' user_agent = parse(ua_string) print(user_agent.is_mobile) # True print(user_agent.device.family) # 'iPhone' Verify before relying: - Whether ua-parser's bundled device database is current enough for modern user agents (package has not been updated since 2020). - Compatibility with Python versions beyond 3.8 (classifiers only list up to 3.8; no explicit support statement for newer versions). ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 11.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags user agent parsing, detect mobile device, browser detection, device identification, parse user agent string, tablet detection, touch screen detection, device capabilities, user-agent-parsing, device-detection, abandoned-but-stable [View on SkillFed](https://skillfed.io/packages/user-agents) · [View on PyPI](https://pypi.org/project/user-agents/)