user-agents
A library to identify devices (phones, tablets) and their capabilities by parsing browser user agent strings.
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
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 · maintenance · safety
MIT (permissive) — 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.
last release 2020-08-23 (2182 days) · last repo commit 2023-02-16 · 1,514 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 11,641,606 downloads/mo, #1,374 on PyPI
Alternatives
Verify before relying
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'- 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).
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 on this page. Verify before relying on it.
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
user-agents on PyPI
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 | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 1 packageua-parser |
| Maintenance | Abandoned 2,182 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 11,641,606 / month, #1,374 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableEnvironment :: Web EnvironmentIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Topic :: Internet :: WWW/HTTPTopic :: Software Development :: Libraries :: Python Modules |
Evidence: user_agents-2.2.0-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “tablet detection”
- user-agentsParses browser user agent strings to identify device type (mobile,…
- pymobiledetectDetects mobile phones and tablets from HTTP user-agent strings and…
- django-user-agentsParses HTTP User-Agent headers in Django to identify visitor browser,…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also device-detector · django-user-agents · pymobiledetect · ua-parser · woothee · crawlerdetect · ua-parser-rs · httpagentparser · python-fullykiosk · fake-useragent